fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. string str = "a,b,c,d";
  8. string[] parts = str.Split(',');
  9.  
  10. for (int i = 0; i < parts.Length-1; i++)
  11. Console.WriteLine("[group" + i + " : " + parts[i] + " " + parts[i+1]+ "]");
  12. }
  13. }
Success #stdin #stdout 0.03s 34752KB
stdin
Standard input is empty
stdout
[group0 : a b]
[group1 : b c]
[group2 : c d]