转换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
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
相关文章推荐
- Oracle 把秒转成时分秒格式(hh24:mm:ss);检测字符串是否是数字;字符串转换为数字
- 检测字符串是否含有html标签的检测fn
- vb 去掉html中的回车和tab;转换部分html大写标签为小写
- 检测字符串是否含有html标签的检测fn
- JavaScript检测字符串中是否含有html标签实现方法
- vb 去掉html中的回车和tab;转换部分html大写标签为小写
- JavaScript检测字符串中是否含有html标签实现方法
- java正则表达式去掉所有HTML标签
- 检测当前URL是否可连接或是否有效(一)
- 常用方法一:随机数生成、检测非法字符、判断数字格式、是否为空、枚举值转化为数组
- 检测app是否存在的Html
- selenium webdriver获取不到标签文本及将html特殊符号&转换为正常字符的方法
- C#用正则表达式去掉Html中的script脚本和html标签
- python检测字符串是否只由数字组成
- php 判断字符串中是否包含html标签
- Lua判断变量是否为数字、字符串是否可以转换为数字等
- PHP判断字符是否为字母/数字检测/password_hash密码加密
- python去掉html标签
- 去掉内容中的所有全部html标签。
- 去掉html标签和空格等