Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello
I have a text box each line contain Name & Space & Address
example
Kosay London
Hassan Paris

How I can list each Name and Address in list box ?
the result
Kosay
London
Hassan
Paris

I use vb.net 2008
Thank you
Posted
Updated 31-Jan-13 4:00am
v2
Comments
Sandeep Mewara 31-Jan-13 9:54am    
You have not mentioned language, yet the logic remains same:
Use Split method on space to get the name and address separately and use that as list item. Try out.
Sergey Alexandrovich Kryukov 31-Jan-13 10:42am    
Please stop posting fake "answers" using "Add your solution here", which is reserved for the cases when you provide some help in response to question. Please understand: this a kind of abuse which may cause abuse reports; a number of members lost their account as a result. In your case, I hope this was just a mistake, so just stop doing it.
—SA

1 solution

You could use the Split method on the string you get from the TextBox.Text property, but because users cannot be trusted to provide properly formatted input, you'd probably be better off parsing the string with a Regular Expression to get the items.
 
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