How to create one long string from a collection of values
How would I create one long string from a collection of values? What I mean by this is - say that you have a listbox of e-mail addresses and you want to be able to put them all together with semi-colons after them and into one string that will be used as an e-mail address.
email@example.com; firstname.lastname@example.org; email@example.com; firstname.lastname@example.org
Thank you all for your comments, its really helped me out tremendously!
If you have filled your DropDownList using a DataSet it will be easier, what you have to do is this:
Dim X as Integer
Dim YourLongString as String
For X = 0 to Data_Set_Emails.Rows.Count()
YourLongString = DataSet_Emails.Tables("Emails").Rows(x)("email")
Last edited by enb141; 07-27-2004 at 03:56 PM.
If you have a listbox called lstEmail:
Dim s As String = ""
Dim i As Int16
For i = 0 To lstEmail.Items.Count - 1
s &= lstEmail.Items(i).ToString() & "; "
's = the string
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)