printEscaped

ref
W
printEscaped
(
C
W
)
(
scope return ref W w
,
scope const(C)[] str
)
if (
isOutputRange!(W, C)
)

Examples

import mir.format: stringBuf;
stringBuf w;
assert(w.printEscaped("Hi \a\v\0\f\t\b \\\r\n" ~ `"@nogc"`).data == `Hi \a\v\0\f\t\b \\\r\n\"@nogc\"`);
w.reset;
assert(w.printEscaped("\x03").data == `\x03`, w.data);

Meta