Case insensitive comparison
casecmp?
compares 2 strings without taking case into account. When it comes to unicode characters, there are a few subtleties! With a non-compatible type, the method returns nil
rather than an exception.
There’s also the casecmp
method for comparing 2 strings without taking case into account, but it returns -1, 0 or 1 (or nil
if incompatible) which can be used to sort, for example.