VB.NET for beginners : how to create Split string Array functions and String.Split() Method using for each looping in vb.net
Split Function in Vb.Net - VB.Net Split () function as a separator for a string, the string was split with a character strings will be return into an array element. for an examples if you have a string like "Hello/World" and split on the "/" character to get an array of: "Hello" "World".
Please Read :
Compile and run your applications, and will get result like this picture :
Download Full source code Split() Functions Vb.NET
Please Read :
How to Split() Array In VB.NET
Now we will make a simple project using visual studio 2010 or visual studio 2015. we will rename a new project with "SplitInVBNet", and at the form1.vb just design it look like this picture :Source Code Split() Array
Just write all source code above on button click event
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
' declare a text as Textbox1.tex
Dim text As String = TextBox1.Text
' declare for split character
Dim words As String() = text.Split(" ")
' declare the word is a string
Dim word As String
' do looping
For Each word In words
' show the split drom the string
TextBox2.AppendText(word & vbNewLine)
Next
End Sub
End Class
Compile and run your applications, and will get result like this picture :
Download Full source code Split() Functions Vb.NET
COMMENTS