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')
"hello".tr_s('el', '*')
"hello".tr_s('el', 'hx')
Show source
/*
* call-seq:
* str.tr_s(from_str, to_str) => new_str
*
* Processes a copy of <i>str</i> as described under <code>String
* then removes duplicate characters in regions that were affected by the
* translation.
*
* "hello".tr_s('l', 'r')
* "hello".tr_s('el', '*')
* "hello".tr_s('el', 'hx')
*/
static VALUE
rb_str_tr_s(str, src, repl)
VALUE str, src, repl;
{
str = rb_str_dup(str);
tr_trans(str, src, repl, 1);
return str;
}