Split a Concatenated String with a Delimiter

Here is how to split a concatenated string with a delimiter and remove empty entries.

public static void Test()     {    string concatenatedString = ",ONE,,TWO,,,THREE,,";    char[] charSeparator = new char[] {','};    string[] splitArray= concatenatedString.Split(charSeparator,      StringSplitOptions.RemoveEmptyEntries);}
Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Related Posts