From: "Guy N. Hurst" Date: 2000-12-13T04:44:32+09:00 Subject: [ruby-talk:7103] Re: Rubyize this method Dave Thomas wrote: > ... > > Not quite the same, though. Chris' method > > lopOff("fred", "e") would return "d" > "fred".lopOff("e") would return "frd" > > If the latter is acceptable, then > > s[substr] = "" > > is another idiom. > > Dave Good point, and I would add s[/^#{substr}/] = "" as another option corresponding to my previous post, (and Aleksi's ;-) which requires the specified substring to exist at the front. Guy N. Hurst -- HurstLinks Web Development http://www.hurstlinks.com/ Norfolk, VA - (757)623-9688 PHP/MySQL - Ruby/Perl - HTML/Javascript