Ruby has a bunch of “bang!” functions for in-place modification. Those are gsub!, capitalize!, downcase!, upcase!, delete!, reverse!, slice!, and others. It’s always a good idea to use them as much as you can.
Most of the time they CANNOT be used in my code because they do not return the unmodified string if unmodified - they return NIL.
So for instance:
would seem to be an ideal place to use bang variants (case insensitive match) but I risk it being already lower case. What am I missing.