Ruby "bang" methodsEdit

Many Ruby methods follow a "bang" pattern to differentiate destructive messages (which alter the object to which they are sent) from non-destructive ones (which do not alter the receiving object).


The capitalize method of the String class returns a capitalized copy of a string, but the capitalize! (bang variant) method directly modifies the string object itself.

See also