End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
String#gsub!
str.gsub!(pattern, replacement) → str or nil
str.gsub!(pattern, hash) → str or nil
str.gsub!(pattern) {|match| block } → str or nil
str.gsub!(pattern) → an_enumerator
string.c
View on GitHub ↗
static VALUE
rb_str_gsub_bang(int argc, VALUE *argv, VALUE str)
{
str_modify_keep_cr(str);
return str_gsub(argc, argv, str, 1);
}
Performs the substitutions of String#gsub in place, returning str, or nil if no substitutions were performed. If no block and no replacement is given, an enumerator is returned instead.