Function fmtString [src]

Return a formatter for escaping a double quoted Zig string.

Prototype

pub fn fmtString(bytes: []const u8) std.fmt.Alt([]const u8, stringEscape)

Parameters

bytes: []const u8

Example

test fmtString { try std.testing.expectFmt("\\x0f", "{f}", .{fmtString("\x0f")}); try std.testing.expectFmt( \\" \\ hi \x07 \x11 \" derp '" , "\"{f}\"", .{fmtString(" \\ hi \x07 \x11 \" derp '")}); }

Source

pub fn fmtString(bytes: []const u8) std.fmt.Alt([]const u8, stringEscape) { return .{ .data = bytes }; }