End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
String#tr!
str.tr!(from_str, to_str) → str or nil
string.c
View on GitHub ↗
static VALUE
rb_str_tr_bang(VALUE str, VALUE src, VALUE repl)
{
return tr_trans(str, src, repl, 0);
}
Translates str in place, using the same rules as String#tr. Returns str, or nil if no changes were made.