/// <summary>
/// 替换html中的特殊字符
/// </summary>
/// <param name="theString">需要进行替换的文本。</param>
/// <returns>替换完的文本。</returns>
public static string HtmlEncode(string theString)
{
theString = theString.Replace(">", ">");
theString = theString.Replace("<", "<");
theString = theString.Replace(" ", " ");
theString = theString.Replace("'", "'");
theString = theString.Replace(",", ",");
theString = theString.Replace("/'", "'");
theString = theString.Replace("/n", "<br/> ");
return theString;
}
asp.net 特殊字符处理
最新推荐文章于 2018-09-11 15:35:26 发布