摘要: asp.net开发中,有时需要对读出的文本进行处理,例如不需要html格式,需要数据直接以文本方式显示,这时就需要一个方法来去除html。具体代码如下:因为是利用正则来处理,所以需要添加命名空间:using System.Text.RegularExpressions;public static string RemoveHTML(string Htmlstring) { //删除脚本 Htmlstring = Regex.Replace(Htmlstring, @"<script[^>]*?>.*?</script>", "&quo 阅读全文
posted @ 2012-01-03 14:59 苦咖啡~ 阅读(4118) 评论(1) 推荐(0) 编辑