Imports System
Imports System.Collections
Public Class MainClass
Shared Sub Main(ByVal args As String())
Dim s1 As String = "One,Two,Three "
Const Space As Char = " "c
Const Comma As Char = ","c
Dim delimiters( ) As Char = {Space, Comma}
Dim output As String = ""
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 &= ctr.ToString( )
output &= ": "
output &= subString
output &= Environment.NewLine
Next subString
Console.WriteLine(output)
End Sub
End Class
|