当前位置: 首页 > 图文教程 > 网络编程 > ASP > ASP去掉字符串头尾连续回车和空格的Function

ASP
asp OpenTextFile文本读取与写入实例代码
在ASP编程中nothing代表什么意思?
asp之让Session永不过期
ASP获取ACCESS数据库表名及结构的代码
推荐一篇不错的新手asp编程的基本法则
最简洁的asp多重查询的解决方案
ASP 判断是否有中文的代码
asp.net常用函数收藏
asp下几种常用排序算法
asp获取数据库中表名和字段名的代码
简单的asp采集代码教程
asp生成带有样式的word文件方法
实用301转向到另一域名相应页面的asp代码
asp伪继承初探_实例代码
asp代理采集的核心函数代码
js table排序类代码
ASP UTF-8页面乱码+GB2312转UTF-8 +生成UTF-8格式的文件(编码)
Asp生成RSS的类_给网站加上RSS
utf-8 网页不显示+utf-8网页乱码的通用解决方法
asp截取指定英汉混合字符串_支持中文

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 39 ::
收藏到网摘: n/a

去掉字符串头尾的连续的回车和空格 去掉字符串开头的连续的回车和空格 去掉字符串末尾的连续的回车和空格 '去掉字符串头尾的连续的回车和空格
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