fork(12) download
  1. using System;
  2. using System.Text;
  3. using System.Text.RegularExpressions;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. var str = "dog:Cat,hi:Bye,num:,1,2,3,5,6,7,8,9,10,this:that";
  10.  
  11. var result = Regex.Split(str, @",(?=\w+:)");
  12. foreach (var entry in result)
  13. Console.WriteLine(entry);
  14. }
  15. }
Success #stdin #stdout 0.08s 37264KB
stdin
Standard input is empty
stdout
dog:Cat
hi:Bye
num:,1,2,3,5,6,7,8,9,10
this:that