开发者

Visual C# 2010 - Comma separate contents of Text Box

开发者 https://www.devze.com 2023-02-08 17:13 出处:网络
I\'m trying to create an application where the end user can copy and paste a number of email addresses into a text box, these email addresses will then all be moved onto one line and separated with a

I'm trying to create an application where the end user can copy and paste a number of email addresses into a text box, these email addresses will then all be moved onto one line and separated with a comma and a space, apart from the last one, the resulting value will then be assigned to a v开发者_运维技巧ariable.

How can I split up and comma separate the text value of the textbox as required?


I'll need to assume that these email addresses will be like:

"email1; email2; email3; emailN"

You can use String.Split method:

string[] emailAddresses = txtBox.Text.Split(";");

Is this what you're looking for?

0

精彩评论

暂无评论...
验证码 换一张
取 消