C#正则表达式去除HTMl标签

string html = "<div><p>1、测试</p><p>2、测试</p><p>3、测试</p><div>";//需要去除的值
string strText = System.Text.RegularExpressions.Regex.Replace(html, "<[^>]+>", "");
strText = System.Text.RegularExpressions.Regex.Replace(strText, "&[^;]+;", "");

posted @ 2016-12-07 15:05  丿时空漫步  阅读(1256)  评论(0编辑  收藏  举报