Skip to content

std.fmt: Add {q} format specifier #6756

Closed
@Tetralux

Description

@Tetralux

q meaning "quoted", handy for printf-debugging; especially where \rs are involved.
Generally useful when writing string manipulation code.

var s: []const u8 = "hello\x00world\r\n";
std.debug.warn("Content: {q}\n", .{s});
// Content: "hello\x00world\r\n"

Metadata

Metadata

Assignees

No one assigned

    Labels

    standard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions