c#中如何替换换行符
string strpageContent = strpageContent.Replace("\r\n", "");
这种方式好像无法正确替换
c#中如何替换换行符
string strpageContent = strpageContent.Replace("\r\n", "");
这种方式好像无法正确替换
string pattern = @"\r*\n";
Regex rgx = new Regex(pattern);
string outputStr = rgx.Replace(strpageContent, "");
替换固定字符没必要用正则表达式,效率差。