VB.NET
Dim myString As String = 'A, B, C, D'
Dim delimStr As String = ' ,'
Dim delimiter As Char() = delimStr.ToCharArray()
Dim s As String
For Each s In myString.Split(delimiter)
Response.Write((s.ToString() + '<br>'))
Next
C#
string myString = 'A, B, C, D';
string delimStr = ' ,';
char[] delimiter = delimStr.ToCharArray();
foreach (string s in myString.Split(delimiter))
{
Response.Write (s.ToString ()+ '<br>');
}
Share with