doubt in VB.Net "split" method
-
hi friendz, i hv a doubt in VB.Net i hv a string as "jacab,martin" i want to split it and assign it in FirstName = jacab, SecondName = martin i used "split" method, but for me it doesn't work, is there anyother way t get my result?
self confidence+hard work=SUCCESS
-
hi friendz, i hv a doubt in VB.Net i hv a string as "jacab,martin" i want to split it and assign it in FirstName = jacab, SecondName = martin i used "split" method, but for me it doesn't work, is there anyother way t get my result?
self confidence+hard work=SUCCESS
Try this
Dim arNames() As String = Split("james,martin", ",") Dim sName As String = arNames(0) Dim fName As String = arNames(1)
-
Try this
Dim arNames() As String = Split("james,martin", ",") Dim sName As String = arNames(0) Dim fName As String = arNames(1)
THANKS A LOT, THIS ALSO WORKIONG YAAR, Dim memberName(2) As String Dim memberLName As String Dim memberFName As String memberName = memberNameTextBox.Text.Split(“,”) memberLName = memberName(0).Trim memberFName memberName(1).Trim
self confidence+hard work=SUCCESS
-
THANKS A LOT, THIS ALSO WORKIONG YAAR, Dim memberName(2) As String Dim memberLName As String Dim memberFName As String memberName = memberNameTextBox.Text.Split(“,”) memberLName = memberName(0).Trim memberFName memberName(1).Trim
self confidence+hard work=SUCCESS
Just a minor issue, this produces a 3 element array 0,1,2
Dim memberName(2) As String
This is not relevant to your current code but will trip you if you ever use memberName.lenght (which is 3 NOT 2)