字符串操作

  • 字符串里所有的的换行符都去掉:textStr = Regex.Replace(textStr, @"[/n/r]", ""); 
  • 去掉末尾的换行符:textStr = textStr.TrimEnd((char[])"/n/r".ToCharArray());
原文地址:https://www.cnblogs.com/code1992/p/10218585.html