Click here to Skip to main content
12,894,219 members (84,350 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB 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
Updated 31-Jan-13 4:00am
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.

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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170424.1 | Last Updated 31 Jan 2013
Copyright © CodeProject, 1999-2017
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