Imports System.Text
Class Tester
Public Shared Sub Main( )
Dim s1 As String = "One,Two,Three Liberty Associates, Inc."
Const Space As Char = " "c
Const Comma As Char = ","c
Dim delimiters( ) As Char = {Space, Comma}
Dim output As New StringBuilder( )
Dim ctr As Integer = 0
Dim resultArray As String( ) = s1.Split(delimiters)
Dim subString As String
For Each subString In resultArray
ctr = ctr + 1
output.AppendFormat("{0} : {1}" & Environment.NewLine, ctr, subString)
Next subString
Console.WriteLine(output)
End Sub
End Class
|