using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.IO; using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; namespace Znyc.Admin.Commons.Extend { /// /// 字符串处理 /// public static class ExtString { /// /// 过滤html格式 /// /// /// public static string NoHTML(this string Htmlstring) { Htmlstring = Regex.Replace(Htmlstring, @"", "", RegexOptions.IgnoreCase); Htmlstring = Regex.Replace(Htmlstring, @"", "", RegexOptions.IgnoreCase); Htmlstring = Regex.Replace(Htmlstring, @"", "", RegexOptions.IgnoreCase); Htmlstring = Regex.Replace(Htmlstring, @"<.*?>", "", RegexOptions.IgnoreCase); 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, @"