fork download
  1. using System;
  2. using System.Text;
  3. using System.Text.RegularExpressions;
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. // your code goes here
  9. var s = "I have a a string like this \\nThis is a new line string\\nThis is another-new-line";
  10. Console.Write(Regex.Escape(s));
  11.  
  12. }
  13. }
  14.  
Success #stdin #stdout 0.04s 29320KB
stdin
Standard input is empty
stdout
I\ have\ a\ a\ string\ like\ this\ \\nThis\ is\ a\ new\ line\ string\\nThis\ is\ another-new-line