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

    企业400电话 网络优化推广 AI电话机器人 呼叫中心 网站建设 商标✡知产 微网小程序 电商运营 彩铃•短信 增值拓展业务
    ASP去掉字符串头尾连续回车和空格的Function

    复制代码 代码如下:

    '去掉字符串头尾的连续的回车和空格
    function trimVBcrlf(str)
    trimVBcrlf=rtrimVBcrlf(ltrimVBcrlf(str))
    end function

    '去掉字符串开头的连续的回车和空格
    function ltrimVBcrlf(str)
    dim pos,isBlankChar
    pos=1
    isBlankChar=true
    while isBlankChar
    if mid(str,pos,1)=" " then
    pos=pos+1
    elseif mid(str,pos,2)=VBcrlf then
    pos=pos+2
    else
    isBlankChar=false
    end if
    wend
    ltrimVBcrlf=right(str,len(str)-pos+1)
    end function

    '去掉字符串末尾的连续的回车和空格
    function rtrimVBcrlf(str)
    dim pos,isBlankChar
    pos=len(str)
    isBlankChar=true
    while isBlankChar and pos>=2
    if mid(str,pos,1)=" " then
    pos=pos-1
    elseif mid(str,pos-1,2)=VBcrlf then
    pos=pos-2
    else
    isBlankChar=false
    end if
    wend
    rtrimVBcrlf=rtrim(left(str,pos))
    end function

    上一篇:asp 过滤尖括号内所有内容的正则代码
    下一篇:ASP IE地址栏参数的判断
  • 相关文章
  • 

    © 2016-2020 巨人网络通讯 版权所有

    《增值电信业务经营许可证》 苏ICP备15040257号-8

    ASP去掉字符串头尾连续回车和空格的Function ASP,去掉,字符串,头尾,连续,