效率很高
function replaceb(str,find,replacewith)
   positiona
=1
   i
=0
   
while instrb(positiona,str,find)      
      positiona
=instrb(positiona,str,find)
         strleft
=leftb(str,positiona-1)
         strRight
=rightb(str,lenb(str)-positiona-lenb(find)+1)
         str
=strleft&replacewith&strRight
      i
=i+1
      
if i>60 then
         
exit function
      
end if
   
wend
   replaceb
=str
end function

str2bytes,只适合单字节字符

function str2bytes(str)   
   
for i=1 to lenb(str)
         temp
=temp&midb(str,i,1)
         i
=i+1
   
next
   str2bytes
=temp
end function
Posted on 2005-03-28 20:51  古代  阅读(774)  评论(0)    收藏  举报