From: Andreas Schwarz Date: 2003-07-23T04:38:00+09:00 Subject: Re: String substitution without RegEx Dave Thomas wrote: > irb(main):006:0> a = "dave" >=> "dave" > irb(main):007:0> a["av"] = "onat" >=> "onat" > irb(main):008:0> a >=> "donate" Thanks, now I'm using the following methods: class String def simple_sub!(find, replace) self[find] = replace return true rescue return false end def simple_gsub!(find, replace) c = 0 while self.simple_sub!(find, replace) c += 1 end return c end end end -- AVR-Tutorial, �ber 350 Links Forum f�r AVRGCC und MSPGCC -> http://www.mikrocontroller.net