Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET ListBox Text
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 31-Jan-13 4:28am
kosay851.3K
Edited 31-Jan-13 5:00am
v2
Comments
Sandeep Mewara at 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 at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 535
1 Kornfeld Eliyahu Peter 407
2 Maciej Los 369
3 DamithSL 221
4 OriginalGriff 218
0 OriginalGriff 6,353
1 DamithSL 4,854
2 Maciej Los 4,476
3 Kornfeld Eliyahu Peter 4,058
4 Sergey Alexandrovich Kryukov 3,917


Advertise | Privacy | Mobile
Web04 | 2.8.141223.1 | Last Updated 31 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100