Flowdock
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"
Show source
Register or log in to add new notes.