From: dblack@... Date: 2006-03-28T07:33:52+09:00 Subject: Re: Why do some methods names which replace the content in place doesn't have the "!" sign? Hi -- On Tue, 28 Mar 2006, karl_brodowsky@yahoo.com wrote: > It would make sense to have a pair replace and replace!. > For example for Strings, it could be imagined such methods myreplace > and myreplace!: > a="abcd" > b=a.myreplace('a', 'b') > puts(a) # => "abcd" > puts(b) # => "bbcd" > b=a.myreplace!('a', 'c') > puts(a) # => "cbcd" > puts(b) # => "cbcd" That's not what replace does, though. See sub and sub! David -- David A. Black (dblack@wobblini.net) Ruby Power and Light, LLC (http://www.rubypowerandlight.com) "Ruby for Rails" chapters now available from Manning Early Access Program! http://www.manning.com/books/black