How to split array in VB.NET? What is the syntax form split function? Where to use the split function? Can Splits function separate the defined element by , or / ?
How to split array in VB.NET? What is the syntax form split function? Where to use the split function? Can Splits function separate the defined element by , or / ?
Split function is use to split a string declare in declaration part into separate elements based on a delimiter (such as a comma or space) and stores the resulting elements in a zero-based array. Often times it is necessary to take a string and dice it up in order to extract portions to be used for some obscure purpose. Enter the Split() function. Split is a very easy concept to grasp.
Example of Split String into Array :
Code:Dim words() As String words() = Split(s) Dim strarr As String For i = 0 To UBound(words) ' Eliminate punctuation strarr = Replace(words(i), ".", "") strarr = Replace(tempStr, ",", "") strarr = Replace(tempStr, ":", "") If Len(tempStr) > 0 Then lis.AddItem strarr End If Next
Split Function in vb.net: Returns a zero-based, one-dimensional array containing a specified number of substrings.
Syntax :
Split(expression[, delimiter[, limit[, compare]]])
Bookmarks