using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; namespace Song.Extend { public class Html { /// /// 理解HTML标签 /// /// /// public static string ClearHTML(string html) { if (string.IsNullOrWhiteSpace(html)) return html; //删除脚本 html = Regex.Replace(html, @"]+?>[\s\S]*?", "", RegexOptions.IgnoreCase); //删除HTML html = Regex.Replace(html, @"<(.[^>]*)>", "", RegexOptions.IgnoreCase); html = Regex.Replace(html, @"([\r\n])[\s]+", "", RegexOptions.IgnoreCase); html = Regex.Replace(html, @"-->", "", RegexOptions.IgnoreCase); html = Regex.Replace(html, @"