String.Split Method (Char[]) : String Split « Data Types « VB.Net






String.Split Method (Char[])

  

Public Class SplitTest
    Public Shared Sub Main()
        Dim words As String = "this is a test."
        Dim split As String() = words.Split(New [Char]() {" "c, ","c, "."c, ":"c, CChar(vbTab) })

        For Each s As String In  split
            If s.Trim() <> "" Then
                Console.WriteLine(s)
            End If
        Next s
    End Sub 'Main
End Class 'SplitTest

   
    
  








Related examples in the same category

1.String SplitString Split
2.Split by ControlChars.Tab
3.String.Split Method (Char[], Int32)
4.String.Split Method (Char[], Int32, StringSplitOptions)
5.Split a string delimited by characters and return all elements
6.Split a string delimited by characters and return all non-empty elements
7.Split string into string and empty string
8.StringSplitOptions.RemoveEmptyEntries
9.Split a string delimited by another string and return all elements
10.Split the original string at the delimiter and return all non-empty elements
11.String.Split (Char[], StringSplitOptions) (System)_VB.htm
12.Split with string arrays
13.String.Split (String[], StringSplitOptions)