<%
'**************************************************
'涵数名:gotTopic
'作 用:截字符串数组,中国汉字一个算2个标识符,英语算一个字符
'参 数: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
'=========================================================
'涵数:RemoveHTML(strHTML)
'作用:除去HTML标识
'主要参数: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)
' 解析xml配对结合,并更换掉配对的新项目
For Each Match in Matches
strHtml=Replace(strHTML,Match.Value,"")
Next
RemoveHTML=strHTML
Set objRegExp = Nothing
set Matches=nothing
End Function
%>