C# 正则表达式替换换行

将换行替换成" "字符,如下:

代码一:

string strContent = txtNote.Text;
strContent = Regex.Replace(strContent, "
", "\n");

代码二:

string strContent = txtNote.Text;
Regex regex = new Regex(" "); strContent = regex.Replace(strContent, "\n");
原文地址:https://www.cnblogs.com/AngelLee2009/p/3448215.html