asp.ne去除html的函数代码

asp.net下去除html标签的函数。

复制代码 代码如下:

///
/// 过滤字符串中的html代码
///

///
/// 返回过滤之后的字符串
public static string LostHTML(string Str)
{
string Re_Str = "";
if (Str != null)
{
if (Str != string.Empty)
{
string Pattern = "<\\/*[^<>]*>";
Re_Str = Regex.Replace(Str, Pattern, "");
}
}
return (Re_Str.Replace("\\r\\n", "")).Replace("\\r", "");
}

以上就是asp.ne去除html的函数代码的详细内容,更多请关注0133技术站其它相关文章!

赞(0) 打赏
未经允许不得转载:0133技术站首页 » ASP编程