fork(3) download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. string mystring = "A,B,C,D";
  8. string[] array = mystring.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
  9. string newstring = "";
  10. foreach (var item in array)
  11. {
  12. newstring += "'" + item + "',";
  13. }
  14. newstring = newstring.Remove(newstring.Length - 1);
  15. Console.WriteLine(newstring);
  16. }
  17. }
Success #stdin #stdout 0.02s 33816KB
stdin
Standard input is empty
stdout
'A','B','C','D'