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;
}

posted @ 2014-07-09 15:47  天王星天  阅读(1138)  评论(0编辑  收藏  举报