/// <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;
}
C# 过滤空格、换行、script、style等等标签
最新推荐文章于 2023-06-11 15:31:35 发布