Case insensitive string comparison with casecmp?
I found out today that Ruby has a casecmp? in the String class that compares strings case insensitively:
"Hello".casecmp?("hello") #=> true
"JAX".casecmp?("jAx") #=> true
"foo".casecmp?("bar") #=> false
This is preferable to string_1.downcase == string_2.downcase since it avoids allocating new string objects.