Parsing comma delimited string into textboxes

How would I parse a comma delimited string into multiple text boxes on my form ie:

FirstName, LastName, Birthdate,
Ralph, Malph, 12/25/2004
----------------------------------------
Dim WholeBirthdate as String
Dim Birthdate1 as String
Dim Birthdate2 as String
Dim Birthdate3 as String

txtFirstName.Text = From Beginning to First Comma
txtLastName.Text = From First Comma to Second Comma
WholeBirthdate = From Second Comma to the end
   Take WholeBirthdate and break it into three parts at each "/"
     Birthdate1 = the first number
     Birthdate2 = the second number
     Birthdate3 = the third number

    txtBirthdate1.Text = Birthdate1
    txtBirthdate2.Text  = Birthdate2
    txtBirthdate3.Text  = Birthdate3

How could I do that in vb.net
 
LVL 1
Matrix1000Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

imarshadCommented:
Dim myString As String = "FirstName, LastName, Birthdate,Ralph, Malph, 12/25/2004"

Dim myArray() As String = Split(myString,",")

txtFirstName.Text = myArray(0)
txtLastName.Text = myArray(1)
WholeBirthdate = myArray(2)

Dim myArray2() As String = Split(myString(3),"/")

    txtBirthdate1.Text = myArray2(0)
    txtBirthdate2.Text  = myArray2(1)
    txtBirthdate3.Text  = myArray2(2)
Imran




0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
imarshadCommented:
The line Dim myString As String = "FirstName, LastName, Birthdate,Ralph, Malph, 12/25/2004"
should have been

Dim myString As String = "Ralph, Malph, 12/25/2004"

Imran
0
imarshadCommented:
Oops another typing error......

Dim myArray2() As String = Split(myString(3),"/")

should have been

Dim myArray2() As String = Split(myString(2),"/")

Note that in my sample I have used split function to split your string......Here is the complete declaration of Split function

Function Split(
   ByVal Expression As String,
   Optional ByVal Delimiter As String = " ",
   Optional ByVal Limit As Integer = -1,
   Optional ByVal Compare As CompareMethod = CompareMethod.Binary
) As String()


Imran
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.