Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string replaced = original.Replace("\n", "n");
- string EscapeLikeALiteral (string src) {
- return Regex.Replace(src, @"\(?<simple>['""\0abfnrtv])", (m) => {
- var s = m.Groups["simple"].Value;
- switch (s) {
- case "'": return "'";
- case """: return """;
- case "0": return "