Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- DOWNCASE



  Use downcase! with caution in Ruby

Ruby provides ! to change state of some object in place. Hence if you see some functions have ! appended, it means the state of the caller of the function is expected to be changed. This is a very interesting Ruby feature. But sometimes one should be cautious when using this kind of functions because you would get unexpected behavior if using improperly. Let's take an example of String#downcase!. According to the documentation. Downcases the contents of str, returning nil if...

   RUBY,EXCLAMATION MARK,DOWNCASE     2017-02-10 06:34:44