当前位置: 编程技术>.net/c#/asp.net
asp.net去除HTML标签删除HTML小例子
来源: 互联网 发布时间:2014-08-30
本文导语: 例子,asp.net中去除html标签。 代码示例: /// /// 去除HTML标签 /// /// /// public static string DeleteHTML(string Htmlstring) { //删除HTML Htmlstring = Regex.Replace(Htmlstring, @"]*)>", "", RegexOptions.IgnoreCase); Htmlstring = Regex.Replace(Htmlstring,...
例子,asp.net中去除html标签。
代码示例:
///
/// 去除HTML标签
///
///
///
public static string DeleteHTML(string Htmlstring)
{
//删除HTML
Htmlstring = Regex.Replace(Htmlstring, @"]*)>", "", RegexOptions.IgnoreCase);
Htmlstring = Regex.Replace(Htmlstring, @"([rn])[s]+", "", RegexOptions.IgnoreCase);
Htmlstring = Regex.Replace(Htmlstring, @"-->", "", RegexOptions.IgnoreCase);
Htmlstring = Regex.Replace(Htmlstring, @"
/// 去除HTML标签
///
///
///
public static string DeleteHTML(string Htmlstring)
{
//删除HTML
Htmlstring = Regex.Replace(Htmlstring, @"]*)>", "", RegexOptions.IgnoreCase);
Htmlstring = Regex.Replace(Htmlstring, @"([rn])[s]+", "", RegexOptions.IgnoreCase);
Htmlstring = Regex.Replace(Htmlstring, @"-->", "", RegexOptions.IgnoreCase);
Htmlstring = Regex.Replace(Htmlstring, @"