escaper

Undocumented in source. Be warned that the author may not have intended to support it.
@safe
escaper
(
S
)
()

Examples

Examples: Escaping a text range

//    import std.stdio;
import std.algorithm.comparison : equal;

{ /// Simple string unchanged
    auto test = escaper("text");
    assert(equal(test, "text"));
}
{ /// Unsert esc in front of control chars
    auto test = escaper("t\n #name \r");
    assert(equal(test, r"t\n #name \r"));
}

{ /// Inserts esc in front of  "
    auto test = escaper("t \"#name\" ");
    assert(equal(test, `t \"#name\" `));
}

Meta