<div dir="ltr">Is there an existing way to do it or do I have to roll my own?<div>unittest{</div><div>  assert(escapeC(`a"bc\ndef`~"\n") == `"a\"bc\\ndef\n"`);</div><div>}</div><div><br></div>
<div>Likewise with escapeD (pastable in D code), which would return something like: `r"..."` for more readability</div><div><br></div></div>