ASP如何去掉文章中所有空格,所连续空格
'取消HTML,UBB代码PublicFunctionLoseHtml(ByValContentStr)IfIsNul(ContentStr)ThenLoseHtml="...
'取消HTML,UBB代码
Public Function LoseHtml(ByVal ContentStr)
If IsNul(ContentStr) Then LoseHtml="": Exit Function
Dim objRegExp, Match, Matches
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<.+?>"
Set Matches = objRegExp.Execute(ContentStr)
For Each Match in Matches
ContentStr=Replace(ContentStr,Match.Value,"")
Next
objRegExp.Pattern = "\[.+?\]"
Set Matches = objRegExp.Execute(ContentStr)
For Each Match in Matches
ContentStr=Replace(ContentStr,Match.Value,"")
Next
LoseHtml=ContentStr
Set objRegExp = Nothing
End Function
这代码只能去掉HTML标签,高手能改一下吗?谢谢 展开
Public Function LoseHtml(ByVal ContentStr)
If IsNul(ContentStr) Then LoseHtml="": Exit Function
Dim objRegExp, Match, Matches
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<.+?>"
Set Matches = objRegExp.Execute(ContentStr)
For Each Match in Matches
ContentStr=Replace(ContentStr,Match.Value,"")
Next
objRegExp.Pattern = "\[.+?\]"
Set Matches = objRegExp.Execute(ContentStr)
For Each Match in Matches
ContentStr=Replace(ContentStr,Match.Value,"")
Next
LoseHtml=ContentStr
Set objRegExp = Nothing
End Function
这代码只能去掉HTML标签,高手能改一下吗?谢谢 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询