Fastest way to remove white spaces in string

后端 未结 13 1249
粉色の甜心
粉色の甜心 2020-11-27 18:39

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

13条回答
  •  误落风尘
    2020-11-27 18:58

    string input =Yourinputstring;
    string[] strings = input.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
    foreach (string value in strings)
    {
       string newv= value.Trim();
       if (newv.Length > 0)
       newline += value + "\r\n";
    }
    

提交回复
热议问题