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

来源:互联网 发布:网络连接错误代码1234 编辑:程序博客网 时间:2024/05/16 07:28
'检测是否有效的数字-----------------
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, "&lt;", "<")
     Str = Replace(Str, "&nbsp;", CHR(32))
        Str = Replace(Str, "&nbsp;", CHR(9))
     Str = Replace(Str, "&#160;&#160;&#160;&#160;", CHR(9))
     Str = Replace(Str, "&quot;", CHR(34))
     Str = Replace(Str, "&#39;", 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

 
原创粉丝点击