How to VB.NET String.Split()


VB.Net-Informations.com
SiteMap

Vb.Net String Split function returns an array of String containing the substrings delimited by the given System.Char array.

Public Function Split(ByVal ParamArray separator() As Char) As String()

Parameters:

separator - the given delimiter

Returns:

An array of Strings delimited by one or more characters in separator


Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button1.Click

        Dim str As String
        Dim strArr() As String
        Dim count As Integer
        str = "vb.net split test"
        strArr = str.Split(" ")
        For count = 0 To strArr.Length - 1
            MsgBox(strArr(count))
        Next

    End Sub
End Class

When you execute this programme , you will get "vb.net" "split" "test" in separate messagebox.



  • Sponsored Program








More Source Code :
|  Home  |   VB.NET  |   C#  |   ASP.NET  |   SiteMap  |   Terms of Use  |   About  |