• 企业400电话
  • 微网小程序
  • AI电话机器人
  • 电商代运营
  • 全 部 栏 目

    企业400电话 网络优化推广 AI电话机器人 呼叫中心 网站建设 商标✡知产 微网小程序 电商运营 彩铃•短信 增值拓展业务
    截字符串 去除HTML标记
    %
    '**************************************************
    '函数名:gotTopic
    '作 用:截字符串,汉字一个算两个字符,英文算一个字符
    '参 数: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)
    ' 遍历匹配集合,并替换掉匹配的项目
    For Each Match in Matches
    strHtml=Replace(strHTML,Match.Value,"")
    Next
    RemoveHTML=strHTML
    Set objRegExp = Nothing
    set Matches=nothing
    End Function
    %>
    您可能感兴趣的文章:
    • asp中去除html中style,javascript,css代码
    • HTA文件去除html控件认证和接收命令行参数
    • asp.ne去除html的函数代码
    • asp去除html标记与空格的正则
    • 去除HTML代码中所有标签的两种方法
    • asp去除html的函数代码分析附实例说明
    上一篇:在ASP中用正则表达式对象来校验数据的合法性
    下一篇:学习网址
  • 相关文章
  • 

    © 2016-2020 巨人网络通讯

    时间:9:00-21:00 (节假日不休)

    地址:江苏信息产业基地11号楼四层

    《增值电信业务经营许可证》 苏B2-20120278

    截字符串 去除HTML标记 截,字符串,去除,HTML,标记,