手机
当前位置:查字典教程网 >编程开发 >ASP教程 >ASP去掉字符串头尾连续回车和空格的Function
ASP去掉字符串头尾连续回车和空格的Function
摘要:复制代码代码如下:'去掉字符串头尾的连续的回车和空格functiontrimVBcrlf(str)trimVBcrlf=rtrimVBcrl...

复制代码 代码如下:

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

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】相关文章:

截取实际长度字符串,并用空格替换

旁注-网站小助手旭方修改免杀asp版

Asp根据日期转换成星座输出

ASP中字符与数字操作函数总结

ASP通用模板类

一种理论上最快的Web数据库分页方法

ASP中一个字符串处理类

如何过滤html中的回车空格

asp有效防止网站留言板出现垃圾留言/评论实现思路

在ASP程序中打印Excel表格的新方法

精品推荐
分类导航