作家
登录

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

作者: 来源:www.28hudong.com 2013-03-30 08:25:12 阅读 我要评论

'去掉字符串头尾的连续的回车和空格 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下实现代码的“运行代码”“复制代码”“保存代码”功能源码

Function content_Code(Str) dim ary_String,i,n,n_pos ary_String=split(Str,"[ code ]") n=ubound(ary_String) If n<1 then content_Code=Str Exit function End If for i=1 to n n_pos=inStr(ary_String(i),"[/>>>详细阅读


本文标题:ASP去掉字符串头尾连续回车和空格的Function

地址:http://www.17bianji.com/kaifa2/ASP/32128.html

关键词: 探索发现

乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

网友点评
自媒体专栏

评论

热度

精彩导读
栏目ID=71的表不存在(操作类型=0)