Split with a list of dividers

image_pdfimage_print
   
   

using System;
using System.Text;
class SplitStringApp {
    static void Main(string[] args) {
        string t = "Once,Upon:A/TimeIn'America";
        char[] sep2 = new char[]{' ', ',', ':', '/', '', '''};
        foreach (string ss in t.Split(sep2))
            Console.WriteLine(ss);
    }
}

   
    
     


This entry was posted in Data Types. Bookmark the permalink.