<% '****************************** '函数:RemoveHTML_A(strText) '参数:strText,待处理的字符串 '作者:阿里西西 '日期:2007/7/12 '描述:去除HTML代码中所有标签 '示例:<%=RemoveHTML_A("<b>欢迎光临阿里西西</b>")%> '****************************** Function RemoveHTML_A(strText) Dim nPos1 Dim nPos2
nPos1 = InStr(strText, "<") Do While nPos1>0 nPos2 = InStr(nPos1+1, strText, ">") If nPos2>0 Then strText = Left(strText, nPos1 - 1) & Mid(strText, nPos2 + 1) Else Exit Do End If nPos1 = InStr(strText, "<") Loop
RemoveHTML_A = strText End Function %>
去除HTML代码中所有标签之二
复制代码 代码如下:
<% '****************************** '函数:RemoveHTML_B(strText) '参数:strText,待处理的字符串 '作者:阿里西西 '日期:2007/7/12 '描述:去除HTML代码中所有标签 '示例:<%=RemoveHTML_B("<b>欢迎光临阿里西西</b>")%> '****************************** Function RemoveHTML_B( strText ) Dim RegEx
Set RegEx = New RegExp
RegEx.Pattern = "<[^>]*>" RegEx.Global = True
RemoveHTML_B = RegEx.Replace(strText, "") End Function %>