From: Sam Goldman Date: 2005-06-02T04:45:23+09:00 Subject: Re: Method Chaining Issues Phrogz wrote: >This is a FAQ, though no page on the RubyGarden wiki seems to address >it. > >Some kind soul should search the archives for all the threads and RCRs >surrounding this topic and create a page on the wiki with links, so we >can redirect people to it. > >In short - some people think it's nice that the 'bang' methods return >nil if no change was effected, some people do not. You can either chain >them using intermediary strings: > > string.sub('old','new').reverse > >or you can use the bang methods, but not use chaining > > string.sub!('old','new') > string.reverse! > > > Some people think that "bang" methods shouldn't exist at all! - John Q. Haskell