以下用法和len(),lift(),right()一样。
function strlength(str)
temp_str=len(str)
for i=1 to temp_str
test_str=(mid(str,i,1))
if asc(test_str)>0 then
strlength=strlength+1
else
strlength=strlength+2
end if
next
end function
function strleft(str,l)
temp_str=len(str)
for i=1 to temp_str
test_str=(mid(str,i,1))
strleft=strleft&test_str
if asc(test_str)>0 then
lens=lens+1
else
lens=lens+2
end if
if lens>=l then exit for
next
end function
function strright(str,l)
temp_str=len(str)
for i = temp_str to 1 step -1
test_str=(mid(str,i,1))
strright=test_str&strright
if asc(test_str)>0 then
lens=lens+1
else
lens=lens+2
end if
if lens>=l then exit for
next
end function
