How to Split a text box

bobos051

Member
Joined
May 14, 2009
Messages
6
Programming Experience
Beginner
Please help me with this. Codes to split a text box into 2.
If the input is split into 2 with space in between them, then
continue
else
error.
For example, if a first name and space and surname (Correct).

Hope to hear from you. Thanks.
 
You can split the Text property by using it's Split() function:
VB.NET:
Dim TempStr() As String = TextBox.Text.Split(" ")
TempStr is an array with each element being each piece of the split string
 
Pls can you explain more because i am kind of new to it. Thanks
Sure, Textbox's have a Text property that's a String. All String's have a Split method that allows you to create a String Array based on any character you tell it to. Matt's posted the link that explains how to use the Split method already:
This would be a good place to start:

String.Split Method (System)
For an actual example, see my previous post.
 
Back
Top