var text = "000
1111
222
333";
step1:将字符串中换行符转化成<br/>
var text1 = Regex.Replace(text,@"
?|
","<br/>");
step2:将字符串转成html语言(使用html.raw()方法)
页面上写 @Html.Raw(text1)
var text = "000
1111
222
333";
step1:将字符串中换行符转化成<br/>
var text1 = Regex.Replace(text,@"
?|
","<br/>");
step2:将字符串转成html语言(使用html.raw()方法)
页面上写 @Html.Raw(text1)