The description for “tr” does not state what should happen, if the
second string ist an empty string. In the actual implementation all
character from the object string will be deleted, if they appear in the
first parameter string.
Example >>>>>
irb(main):001:0> ‘Hello, world!’.tr(‘aeiou’,’’)
=> “Hll, wrld!”
EoE >>>>>
My question is: Is this an Error in the implementation or a special
case, which is not documented?
“Returns a copy of str with the characters in from_str replaced by the
corresponding characters in to_str. If to_str is shorter than from_str,
it
is padded with its last character.”