From ruby-talk Fri Jul 29 13:30:24 2005 From: "Jason Voegele" Date: Fri, 29 Jul 2005 13:30:24 +0000 To: ruby-talk Subject: Re: Chopping the beginning of a string elegantly Message-Id: <3456.192.223.163.5.1122643814.squirrel () 192 ! 223 ! 163 ! 5> X-MARC-Message: https://marc.info/?l=ruby-talk&m=112264385320400 On Fri, July 29, 2005 8:41 am, francisrammeloo@hotmail.com said: > 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". [snip] With all the different responses you've received, it's obvious that the Perl mantra "There's More Than One Way To Do It" also holds true with Ruby. :-) -- Jason Voegele "There is an essential core at the center of each man and woman that remains unaltered no matter how life's externals may be transformed or recombined. But it's smaller than we think." -- Gene Wolfe, The Book of the Long Sun