From: Wybo Dekker Date: 2005-07-29T22:01:32+09:00 Subject: Re: Chopping the beginning of a string elegantly francisrammeloo@hotmail.com wrote: >Hi all, > >I'm having some trouble finding an elegant way of removing a part of a >string based on an pattern. > >Suppose I want to chop off the "Begin" in the string "BeginCaption". > > irb(main):001:0> w='BeginCaption' => "BeginCaption" irb(main):002:0> w.slice!(/^Begin/) => "Begin" irb(main):003:0> w => "Caption" -- Wybo