I\'m trying to fetch multiple email addresses seperated by \",\" within string from database table, but it\'s also returning me whitespaces, and I want to remove the whitesp
I haven't done performance testing on this, but it's simpler than most of the other answers.
var s1 = "\tstring \r with \t\t \nwhitespace\r\n"; var s2 = string.Join("", s1.Split());
The result is
stringwithwhitespace