From: "Jörg W Mittag" Date: 2010-09-15T00:10:17+09:00 Subject: Re: method! and method? Gene Angelo wrote: > I am trying to find the meaning of ! and ? appended to method names but > I cannot find what they mean. Can someone explain? They aren't appended to the method name. They are part of the method name. A method ending in '!' or '?' means pretty much the same as a method name ending in 'a' or 'z': it means whatever the author of that method wants it to mean. There is a convention, however: a method name ending in '?' usually indicates a method that returns either a truthy or a falsy value. For example, take the `Integer#even?` method. An integer is either even or it's not. Or `Array#empty?`, `Numeric#zero?`, `Time#thursday?`: an array is either empty or not, a number is either zero or not, a specific date is either a thursday or not. For a method name ending in '!', the convention is the following: if there are two methods that both perform the same operation, but in a slightly different way, then they both get the same name, but the one which is more "surprising" gets an exclamation point appended. For eample: `String#downcase` downcases as string. It returns a new downcased string, but leaves the original untouched. `String#downcase!` *also* downcases a string, but *it* destroys the original string and *replaces* it with a downcased version. jwm