Skip to content
instance method

String#tr!

(::String::selector source, ::string relpacement) -> self?
tr!(selector, replacements) → self or nil

Like String#tr, except:

  • Performs substitutions in self (not in a copy of self).

  • Returns self if any modifications were made, nil otherwise.

Related: Modifying.

See also #tr #tr_s #to_sym #tr_s! also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0