fork(2) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var s = " Line 1\r \r\n Line 2\r\n \r\n more text";
  9. Console.WriteLine(Regex.Replace(s, @"(\r)[\p{Zs}\t]*\r\n", "$1")
  10. .Replace("\r", "<CR>").Replace("\n", "<LF>"));
  11. }
  12. }
Success #stdin #stdout 0.04s 134720KB
stdin
Standard input is empty
stdout
     Line 1<CR>     Line 2<CR><LF>     <CR><LF>     more text