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技术站其它相关文章!