国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

ASP去掉字符串頭尾連續回車和空格的Function

2024-05-04 10:57:10
字體:
來源:轉載
供稿:網友

復制代碼 代碼如下:

'去掉字符串頭尾的連續的回車和空格
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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 揭西县| 慈溪市| 娄烦县| 健康| 长沙县| 横山县| 广宗县| 灌云县| 中山市| 施秉县| 胶州市| 黑水县| 金坛市| 五原县| 麻栗坡县| 五华县| 太和县| 图木舒克市| 当雄县| 绥宁县| 盐池县| 沅江市| 读书| 常德市| 潼南县| 临邑县| 平远县| 民县| 江山市| 津南区| 邵武市| 海阳市| 梅河口市| 高碑店市| 东城区| 沙洋县| 交口县| 德化县| 荆州市| 固原市| 五家渠市|