最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

截字符串 去除HTML標記

 更新時間:2006年06月17日 00:00:00   作者:  
<%
'**************************************************
'函數(shù)名:gotTopic
'作 用:截字符串,漢字一個算兩個字符,英文算一個字符
'參 數(shù):str ----原字符串
' strlen ----截取長度
'返回值:截取后的字符串
'**************************************************
function gotTopic(str,strlen)
if str="" then
gotTopic=""
exit function
end if
dim l,t,c, i
str=replace(replace(replace(replace(str," "," "),""",chr(34)),">",">"),"<","<")
str=replace(str,"?","")
l=len(str)
t=0
for i=1 to l
c=Abs(Asc(Mid(str,i,1)))
if c>255 then
t=t+2
else
t=t+1
end if
if t>=strlen then
gotTopic=left(str,i) & "…"
exit for
else
gotTopic=str
end if
next
gotTopic=replace(replace(replace(replace(gotTopic," "," "),chr(34),"""),">",">"),"<","<")
end function
'=========================================================
'函數(shù):RemoveHTML(strHTML)
'功能:去除HTML標記
'參數(shù):strHTML --要去除HTML標記的字符串
'=========================================================
Function RemoveHTML(strHTML)
Dim objRegExp, Match, Matches
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
'取閉合的<>
objRegExp.Pattern = "<.+?>"
'進行匹配
Set Matches = objRegExp.Execute(strHTML)
' 遍歷匹配集合,并替換掉匹配的項目
For Each Match in Matches
strHtml=Replace(strHTML,Match.Value,"")
Next
RemoveHTML=strHTML
Set objRegExp = Nothing
set Matches=nothing
End Function
%>

相關(guān)文章

最新評論

巩留县| 无为县| 乌拉特后旗| 三门县| 台北县| 夏河县| 杂多县| 星座| 色达县| 桂东县| 绿春县| 和平县| 宿迁市| 中牟县| 大庆市| 仁布县| 涪陵区| 巴里| 巨鹿县| 涪陵区| 清镇市| 扎赉特旗| 大竹县| 太白县| 海晏县| 邯郸市| 故城县| 呼玛县| 包头市| 宁蒗| 瓮安县| 晋州市| 宣威市| 宜春市| 双江| 雷山县| 蒙山县| 成都市| 普兰店市| 禹城市| 宝兴县|