I have a task in which we want to combine email address into a single string which is separated by special characters. Please suggest me what character I use
Asked
Active
Viewed 49 times
-2
-
Outlook Allow pipe | inside email Address – Aditya Potdar Dec 10 '14 at 10:21
-
Choose the one suits your requirement from here -> http://en.wikipedia.org/wiki/Email_address#Invalid_email_addresses – SBirthare Dec 10 '14 at 10:29
-
How about using multiple characters? I suggest "`76266804-ff1d-4235-8c12-d8e15cde7dcf`". – Uwe Keim Dec 10 '14 at 10:30
1 Answers
0
You can use |
which is common used as separator
List<string> emails = new List<string>();
emails.Add("one@example.com");
emails.Add("two@example.com");
string emailString = "";
foreach(var email in emails){
emailString += email + "|";
}
emailString = emailString.TrimEnd('|');
Edit: According to this answer
use back slash but don't forget it to escape such as double or triple backslash

Community
- 1
- 1

asdf_enel_hak
- 7,474
- 5
- 42
- 84
-
Thanks for you answer but outlook allow pipe charters inside email address. Actually I need two charter. I pick one is space . Please suggest another – Aditya Potdar Dec 10 '14 at 10:27
-
1