Click here to Skip to main content
15,888,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to use the Split, Mid and Ubound method..
I have found how to use them on the MSDN website, but I don't understand it very well.

can someone give me some easy examples of these methods?

Thanks
Posted

1 solution

My advice is that if you are using VB.NET and not vb / vba then DONT use split, mid, ubound etc.

VB.NET is a very powerful language (including C#) and so use the current string manipulation methods from .Net not the old legacy VB. There is nothing wrong with the legacy stuff but if you want to progress in development you need to use more appropriate techniques!

Here are some examples:

http://www.dotnetperls.com/substring-vbnet[^]
http://www.dotnetcurry.com/ShowArticle.aspx?ID=190[^]
http://vb.net-informations.com/string/vb.net_String_Split.htm[^]

It would really help if you improved question with some detail on what you want doing to a string?
 
Share this answer
 
Comments
OdeJong 19-Jun-12 8:13am    
thanks for you answer.
I have made a V-Card app and i want to import all the information into my database. My application is working till now. there is on thing that's still not working:

ADR;WORK;PREF:;;Sjoerd Veltmanstraat 15;Drachten;;9203 NJ
ENCODING=QUOTED-PRINTABLE:Sjoerd Veltmanstraat 15

It's going about the first line. I want to show the info after ":" I know ho I can do this but I am trying to get the ";".. out of these line and I still don't know how to do this. That's why I'm trying to use the methods split mid, ubound. greetz me (Y)
db7uk 19-Jun-12 8:43am    
Try something like:

Dim txt As String = "ADR;WORK;PREF:;;Sjoerd Veltmanstraat 15;Drachten;;9203 NJ ENCODING=QUOTED-PRINTABLE:Sjoerd Veltmanstraat 15"
Dim newTxtStrings As New List(Of String)

newTxtStrings = txt.Substring(txt.IndexOf(":") + 1).Split(";").Where(Function(txtString)
Return txtString.Length > 0
End Function).ToList
OdeJong 22-Jun-12 8:59am    
Oke thanks! I will see if I can work it out now. p.s. sorry for late response, greetz me!
OdeJong 27-Jun-12 4:56am    
I'm not getting any further. Do you know how I can make one string, out of 3? So for example: dim strAdresGegevens = strAdres, strPostcode, strWoonplaats

do you know how?
thanks!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900