replaceInString

  how to substitute numbers for letters in a string
strings replace




  replaceInString
>I am in a situation where i need to substitute numbers for letters ala the
>captain crunch decoder ring.  anyone wanna direct me on the fastest method
>for doing this?
>
>brett
>
>


 on replaceInString dChunk,nono,anstatt 
   -- replace any ocurrence of nono in dChunk by anstatt 
  
   set nono.len = the number of chars in nono 
   set dChunk.len = the number of chars in dChunk 
    
   set da=offset(nono,dChunk) 
   repeat while da > 0 
     set dChunk= chars(dChunk,1,da-1) & anstatt & chars(dChunk,da + nono.len,dChunk.len) 
     set da=offset(nono,dChunk) 
   end repeat 
    
   return dChunk 
 end 
  
Best regards

Daniel Plaenitz

Home shock + cgi Bits 'n pieces Director Lingo Shocklets Contact










pageID=l_replaceInString