过滤字符串中的html标签
#region 过滤html标签
/// <summary>
/// 过滤html标签
/// </summary>
/// <param name="contents">要过滤的字符串</param>
/// <returns></returns>
public static string RemoveHtml(string contents)
{
string strTmp = null;
strTmp = Regex.Replace(contents, "<(.[^>]*)>", "");
return strTmp;
}
#endregion
/// <summary>
/// 过滤html标签
/// </summary>
/// <param name="contents">要过滤的字符串</param>
/// <returns></returns>
public static string RemoveHtml(string contents)
{
string strTmp = null;
strTmp = Regex.Replace(contents, "<(.[^>]*)>", "");
return strTmp;
}
#endregion