const std = @import("std");
pub fn main() !void {
const alloc = std.heap.page_allocator;
// allocPrint heap-allocates a right-sized string
const s = try std.fmt.allocPrint(alloc, "{s}={d}", .{ "x", 42 });
// free what the allocator gave us
defer alloc.free(s);
std.debug.print("{s}\n", .{s});
}std.fmt.allocPrint returns an owned string