30 lines
856 B
C#
30 lines
856 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace New_College.Common.Helper
|
|
{
|
|
public static class ClearHtmlHelper
|
|
{
|
|
|
|
public static string SHTML(string html)
|
|
{
|
|
if (!string.IsNullOrWhiteSpace(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;
|
|
}
|
|
}
|
|
}
|