去除HTML标签删除HTML示例代码

复制代码 代码如下:

///
/// 去除HTML标签
///

///
///
public static string DeleteHTML(string Htmlstring)
{
//删除HTML
Htmlstring = Regex.Replace(Htmlstring, @"<(.[^>]*)>", "", RegexOptions.IgnoreCase);
Htmlstring = Regex.Replace(Htmlstring, @"([\r\n])[\s]+", "", RegexOptions.IgnoreCase);
Htmlstring = Regex.Replace(Htmlstring, @"-->", "", RegexOptions.IgnoreCase);
Htmlstring = Regex.Replace(Htmlstring, @"

你可能感兴趣的:(去除HTML标签删除HTML示例代码)