fork download
  1. using System;
  2. using System.IO;
  3. using System.Linq;
  4. using System.Text.RegularExpressions;
  5.  
  6. public class Test
  7. {
  8. public static void Main()
  9. {
  10. var line = "xxx abcdef abcdef xxx zxcvbn zxcvbn xxx poiuy poiuy";
  11. var splts = Regex.Split(line, @"xxx").Where(p => !string.IsNullOrWhiteSpace(p)).ToList();
  12. // Console.WriteLine(splts.Count());
  13. foreach (string match in splts)
  14. {
  15. Console.WriteLine("'{0}'" , match);
  16. }
  17. }
  18. }
Success #stdin #stdout 0.12s 24632KB
stdin
Standard input is empty
stdout
' abcdef abcdef '
' zxcvbn zxcvbn '
' poiuy poiuy'