首页 > 代码库 > C# 去除所有的html标签

C# 去除所有的html标签

/// <summary>
/// 去除所有的html标签
/// </summary>
/// <param name="strhtml"></param>
/// <returns></returns>
public static string Removestriphtml(string strhtml)
{
string stroutput = strhtml;
Regex regex = new Regex(@"<[^>]+>|</[^>]+>");
stroutput = regex.Replace(stroutput, "");
return stroutput;
}