str.tr_s(from_str, to_str) â new_str
Instance Public methods
Processes a copy of str as described under String#tr
,
then removes duplicate characters in regions that were affected by the
translation.
"hello".tr_s('l', 'r') #=> "hero" "hello".tr_s('el', '*') #=> "h*o" "hello".tr_s('el', 'hx') #=> "hhxo"
Please login to continue.