Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear all,

i have developed window application for xml element handling.now my problem was from the tag <headline>toranto; national</headline> i need to get toranto in one textbox and national in another text box.how to split using ; and get the values?
Posted
Comments
Sergey Alexandrovich Kryukov 16-Apr-13 11:05am    
Please stop posting non-answers as "solution". It can give you abuse reports which eventually may lead to cancellation of your CodeProject membership.
Comment on any posts, reply to available comments, or use "Improve question" (above).
Also, keep in mind that members only get notifications on the post sent in reply to there posts.
—SA

Try:
VB
Dim s As String = "toranto; national"
Dim parts As String() = s.Split(";"C)
 
Share this answer
 
Comments
jai_mca 30-Oct-12 7:35am    
dear originalgriff
C means?
OriginalGriff 30-Oct-12 7:55am    
As a suffix to a string, it tells the compiler that it is not a string, but a single character object.
so ";" is a string containing a single semicolon, ";"C is a single character containing a semicolon.
Itz.Irshad 30-Oct-12 7:39am    
If your split-er character is ';' then OriginalGriff is right.
Use code like below
first split by ;
and then substring
VB
Dim a = "<headline>toranto; national</headline>"
Dim ary = a.split(";")

txtbox1.text = ary(0).tostring.substring(ary(0).indexof(">"),ary(0).tostring().length - ary(0).indexof("<"))

txtbox2.text = ary(1).tostring.substring(ary(1).indexof("<"),ary(1).tostring().length - ary(0).indexof("<"))

Happy Coding!
:)
 
Share this answer
 

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