您的位置:首页 > Web前端 > HTML

转换HTML代码;检测是否有效的数字;去掉html标签

2007-11-07 11:05 411 查看
'检测是否有效的数字-----------------
Function IsInteger(Para)
IsInteger=False
If Not (IsNull(Para) Or Trim(Para)="" Or Not IsNumeric(Para)) Then
IsInteger=True
End If
End Function
'转换HTML代码-----------------------
Function HTMLDecode(reString)
Dim Str:Str=reString
If Not IsNull(Str) Then
Str = Replace(Str, "&", "&")
Str = Replace(Str, ">", ">")
Str = Replace(Str, "<", "<")
Str = Replace(Str, " ", CHR(32))
Str = Replace(Str, " ", CHR(9))
Str = Replace(Str, "    ", CHR(9))
Str = Replace(Str, """, CHR(34))
Str = Replace(Str, "'", CHR(39))
Str = Replace(Str, "", CHR(13))
Str = Replace(Str, "<br>", CHR(10))
HTMLDecode = Str
End If
End Function
'去掉html标签,去掉换行
Function NoHtml(strText)
Dim regEx
Set regEx = New RegExp
regEx.Global = True
regEx.IgnoreCase = True
regEx.Pattern = "/n"
strText = regEx.Replace(strText,"")
regEx.Pattern = "/r"
strText = regEx.Replace(strText,"")
regEx.Pattern = "<scrīpt(.*?)>(.*?)<//scrīpt>"
strText = regEx.Replace(strText,"")
regEx.Pattern = "<(.+?)>"
strText = regEx.Replace(strText,"")
NoHtml = strText
End Function
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: