处理换行
asp.net 前台显示换行的几种处理方式,以替换为住,js/C#处理
@Html.Raw(info.Summary.Replace("\n", "<br />"))
@Html.Raw(System.Text.RegularExpressions.Regex.Replace(info.Summary, @"\n", "<br />"))
function ReplaceRntoHtmlBR(str) {
var reg1 = new RegExp("\n", "gi");
var reg2 = new RegExp(" ", "gi");
str = str.replace(reg1, "<br>");
str = str.replace(reg2, " ");
return str;
}