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 text = "abc\r\ndef";
  9. foreach (var s in Regex.Split(text, @"(?<=\r\n|(?<!\r)\n|\r(?!\n))"))
  10. Console.WriteLine("'{0}'",s);
  11. }
  12. }
Success #stdin #stdout 0.06s 21128KB
stdin
Standard input is empty
stdout
'abc
'
'def'