Click here to Skip to main content
11,720,785 members (82,185 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: VB.NET ListBox Text
I have a text box each line contain Name & Space & Address
Kosay London
Hassan Paris

How I can list each Name and Address in list box ?
the result

I use 2008
Thank you
Posted 31-Jan-13 3:28am
Edited 31-Jan-13 4:00am
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.

1 solution

Rate this: bad
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.

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 2,179
1 OriginalGriff 924
2 F-ES Sitecore 640
3 Maciej Los 609
4 Richard MacCutchan 540

Advertise | Privacy | Mobile
Web01 | 2.8.150901.1 | Last Updated 31 Jan 2013
Copyright © CodeProject, 1999-2015
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