ASP去掉字符串頭尾連續(xù)回車和空格的Function
更新時間:2008年12月22日 00:45:48 作者:
去掉字符串頭尾的連續(xù)的回車和空格 去掉字符串開頭的連續(xù)的回車和空格 去掉字符串末尾的連續(xù)的回車和空格
復(fù)制代碼 代碼如下:
'去掉字符串頭尾的連續(xù)的回車和空格
function trimVBcrlf(str)
trimVBcrlf=rtrimVBcrlf(ltrimVBcrlf(str))
end function
'去掉字符串開頭的連續(xù)的回車和空格
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
'去掉字符串末尾的連續(xù)的回車和空格
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
相關(guān)文章
實例分析之用ASP編程實現(xiàn)網(wǎng)絡(luò)內(nèi)容快速查找的代碼
實例分析之用ASP編程實現(xiàn)網(wǎng)絡(luò)內(nèi)容快速查找的代碼...2007-03-03
通過Response.Flush()實現(xiàn)下載失敗的解決方法
Response.Flush()實現(xiàn)對服務(wù)端文件的下載時,會失敗,不能正常彈出IE下載框,通過測試發(fā)現(xiàn)時瀏覽器的安全設(shè)置問題,如下操作便可解決2013-08-08
ASP模仿google suggest風(fēng)格實現(xiàn)下拉菜單效果
這篇文章主要介紹了ASP模仿google suggest風(fēng)格實現(xiàn)下拉菜單效果,需要的朋友可以參考下2015-09-09

