The OpenD Programming Language

printEscaped

void
printEscaped
(
C
W
)
(
scope ref W w
,
scope const(C)[] str
)
if ()

Examples

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

Meta