/// <summary> /// 过滤空格、换行、script、style等等标签 /// </summary> /// <param name="html">html的内容</param> /// <returns>处理后的文本</returns> internal static string SHTML(string html) { html = html.Trim(); html = html.Replace(@"/<script[^>]*?>(.*?)<\/script>/si", ""); html = html.Replace(@"/<style[^>]*?>(.*?)<\/style>/si", ""); html = html.Replace("\t", ""); html = html.Replace("\r\n", ""); html = html.Replace("\r", ""); html = html.Replace("\n", ""); html = html.Replace(" ", ""); html = html.Replace(" ", ""); //html=html.Replace("",""); return html; }
时间: 2024-10-16 10:51:08