Ruby/String/tr

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск

Translation from one set of characters to another

puts "hello".tr("aeiou", "AEIOU")  # => "hEllO": capitalize vowels. Also tr!
puts "hello".tr("aeiou", " ")      # => "h ll ": convert vowels to spaces



tr method from string

"LOWERCASE ALL VOWELS".tr("AEIOU", "aeiou")