亚洲最大看欧美片,亚洲图揄拍自拍另类图片,欧美精品v国产精品v呦,日本在线精品视频免费

  • 站長(zhǎng)資訊網(wǎng)
    最全最豐富的資訊網(wǎng)站

    截字符串 去除HTML標(biāo)記

    <%
    ‘**************************************************
    ‘函數(shù)名:gotTopic
    ‘作 用:截字符串,漢字一個(gè)算兩個(gè)字符,英文算一個(gè)字符
    ‘參 數(shù):str —-原字符串
    ‘ strlen —-截取長(zhǎng)度
    ‘返回值:截取后的字符串
    ‘**************************************************
    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標(biāo)記
    ‘參數(shù):strHTML –要去除HTML標(biāo)記的字符串
    ‘=========================================================
    Function RemoveHTML(strHTML)
    Dim objRegExp, Match, Matches
    Set objRegExp = New Regexp
    objRegExp.IgnoreCase = True
    objRegExp.Global = True
    ‘取閉合的<>
    objRegExp.Pattern = “<.+?>”
    ‘進(jìn)行匹配
    Set Matches = objRegExp.Execute(strHTML)
    ‘ 遍歷匹配集合,并替換掉匹配的項(xiàng)目
    For Each Match in Matches
    strHtml=Replace(strHTML,Match.Value,””)
    Next
    RemoveHTML=strHTML
    Set objRegExp = Nothing
    set Matches=nothing
    End Function
    %>

    贊(0)
    分享到: 更多 (0)
    網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)