Ruby/String/casecmp
Материал из Wiki.crossplatform.ru
Версия от 17:10, 26 мая 2010; (Обсуждение)
casecmp method
"a".casecmp "A" # => 0
Case insensitive comparison. (ASCII text only)
# casecmp works like <=> and returns -1 for less, 0 for equal, +1 for greater "world".casecmp("WORLD") # => 0 "a".casecmp("B") # => -1 (<=> returns 1 in this case)