Part String

T

TCB

How can I separate multiple email addresses entered in a single textbox so I
can send email in ASP.NET 2.0, the email addresses are separated by (,) or
(;)

Thanks
 
N

Nathan Sokalski

Try using the String.Split() method. This method returns an array of Strings
using one or more specified delimiters. I'm sure you can figure out the
syntax using the documentation, if you need help just ask. Good Luck!
 
G

Guest

If the emails are seperated with mixing commas and semicolons, you can use
String.Replace() to unify the seperator character first, then use
String.Split() to split it into a string array.

For example:
Dim s As String = TextBox1.Text
Dim addresses() As String
s = s.Replace(",", ";") 'Replace all "," with ";"
addresses = s.Split(";")

Now you can just loop through the addresses to get each address.
Hope this helps,
VHD50.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,123
Latest member
Layne6498
Top