Hapus kembalian dan spasi berturut-turut di awal dan akhir string. Hapus kembalian berturut-turut dan spasi di awal dan akhir string.
fungsi trimVBcrlf(str)
trimVBcrlf=rtrimVBcrlf(ltrimVBcrlf(str))
fungsi akhir
'Hapus tanda pengembalian dan spasi berturut-turut di awal string
fungsiltrimVBcrlf(str)
pos redup, isBlankChar
pos=1
isBlankChar=benar
sementara isBlankChar
jika pertengahan(str,pos,1)= maka
pos=pos+1
elseif mid(str,pos,2)=VBcrlf lalu
pos=pos+2
kalau tidak
isBlankChar=salah
berakhir jika
pergi ke
ltrimVBcrlf=kanan(str,len(str)-pos+1)
fungsi akhir
'Hapus pengembalian dan spasi berturut-turut di akhir string
fungsirtrimVBcrlf(str)
pos redup, isBlankChar
pos=len(str)
isBlankChar=benar
sementara isBlankChar dan pos>=2
jika pertengahan(str,pos,1)= maka
pos=pos-1
elseif mid(str,pos-1,2)=VBcrlf lalu
pos=pos-2
kalau tidak
isBlankChar=salah
berakhir jika
pergi ke
rtrimVBcrlf=rtrim(kiri(str,pos))
fungsi akhir