/// 除去所有在HTML元素中标记
public static string StripHTML(string strHtml)
{
string strOutput=strHtml;
Regex regex = new Regex(@"<[^>]+>|]+>");
strOutput = regex.Replace(strOutput,"");
return strOutput;
}
注:Regex 需要引用 System.Text.RegularExpressions
/// 除去所有在HTML元素中标记
public static string StripHTML(string strHtml)
{
string strOutput=strHtml;
Regex regex = new Regex(@"<[^>]+>|]+>");
strOutput = regex.Replace(strOutput,"");
return strOutput;
}
注:Regex 需要引用 System.Text.RegularExpressions