-
去掉HTML标记和脚本正则
- using System.Text.RegularExpressions;
-
-
-
- public static string NoHTML(string Htmlstring)
- {
-
-
- Htmlstring = Regex.Replace(Htmlstring, @"<script[^>]*?>.*?</script>", "", 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, @"<!--.*", "", RegexOptions.IgnoreCase);
-
- Htmlstring = Regex.Replace(Htmlstring, @"&(quot|#34);", "\"", RegexOptions.IgnoreCase);
-
- Htmlstring = Regex.Replace(Htmlstring, @"&(amp|#38);", "&", RegexOptions.IgnoreCase);
-
- Htmlstring = Regex.Replace(Htmlstring, @"&(lt|#60);", "<", RegexOptions.IgnoreCase);
-
- Htmlstring = Regex.Replace(Htmlstring, @"&(gt|#62);", ">", RegexOptions.IgnoreCase);
-
- Htmlstring = Regex.Replace(Htmlstring, @"&(nbsp|#160);", " ", RegexOptions.IgnoreCase);
-
- Htmlstring = Regex.Replace(Htmlstring, @"&(iexcl|#161);", "\xa1", RegexOptions.IgnoreCase);
-
- Htmlstring = Regex.Replace(Htmlstring, @"&(cent|#162);", "\xa2", RegexOptions.IgnoreCase);
-
- Htmlstring = Regex.Replace(Htmlstring, @"&(pound|#163);", "\xa3", RegexOptions.IgnoreCase);
-
- Htmlstring = Regex.Replace(Htmlstring, @"&(copy|#169);", "\xa9", RegexOptions.IgnoreCase);
-
- Htmlstring = Regex.Replace(Htmlstring, @"&#(\d+);", "", RegexOptions.IgnoreCase);
-
- Htmlstring.Replace("<", "");
-
- Htmlstring.Replace(">", "");
-
- Htmlstring.Replace("\r\n", "");
-
- Htmlstring = HttpContext.Current.Server.HtmlEncode(Htmlstring).Trim();
-
- return Htmlstring;
-
- }
-
相关阅读:
圆 abc模块的练习
组合,封装,访问限制机制,property,多态,抽象类(了解),鸭子类型,多态旋技操作。
继承初体验,寻找继承关系,继承背景下和对象属性查找顺序,派生,(子类派生出新的属性,并重新父类的属性),新式类与经典类,钻石继承。钻石继承实现修改jison模块数据类型。
面向对象继承练习题
基于面向对象设计一个对战游戏练习。
面向对象基础,类,对象、对象与类的查找顺序,对象绑定方法的特殊之处,python一切皆是对象
HihoCoder
HihoCoder
2019 牛客暑期多校 第三场 F Planting Trees (单调队列+尺取)
2019 牛客暑期多校 第八场 A All-one Matrices (单调栈+前缀和)
-
原文地址:https://www.cnblogs.com/wuhuisheng/p/1778789.html
Copyright © 2020-2023
润新知