源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

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

  • 时间:2021-07-28 14:05 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:ASP去掉字符串头尾连续回车和空格的Function
[u]复制代码[/u] 代码如下:
'去掉字符串头尾的连续的回车和空格 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
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部