fork download
  1. using System;
  2. using System.Linq;
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. string str = "12345MLOL68";
  8. int[] indices = {5, 6, 9};
  9. Console.WriteLine(str);
  10. indices = indices.OrderByDescending(x => x).ToArray();
  11.  
  12. foreach (var index in indices)
  13. {
  14. str = str.Insert(index, ",");
  15. }
  16. Console.WriteLine(str);
  17. }
  18. }
Success #stdin #stdout 0.04s 34016KB
stdin
Standard input is empty
stdout
12345MLOL68
12345,M,LOL,68