method

tr_s

v1_8_6_287 - Show latest stable - Class: String
tr_s(p1, p2)
public

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"