1.去掉字符串中的所有的空 string s = " select * from \r\n where a =b "; s = Regex.Replace(s, @"\s", ""); 转载于:https://www.cnblogs.com/SoftWareIe/p/10612787.html