asp 去除HTML格式

Function stripHTML(strHTML)
Dim objRegExp,strOutput
Set objRegExp =New Regexp
objRegExp.IgnoreCase
=True
objRegExp.Global
=True
objRegExp.Pattern
="<.+?>"
strOutput
= objRegExp.Replace(strHTML, "")
stripHTML
= strOutput
Set objRegExp =Nothing
End Function

 

=======================

'限定100个字符串
function cutstr(tempstr,tempwid)
iflen(tempstr)>tempwid then
cutstr
=left(tempstr,tempwid)&"..."
else
cutstr
=tempstr
endif
end function

'为图片则不显示
function cutimg(cutnew)
ifinstr(cutnew,"IMG") >0then
cutimg
="..."
else
cutimg
=cutnew
endif
end function
posted @ 2011-04-07 12:02  【唐】三三  阅读(590)  评论(0编辑  收藏  举报