initialize_copy(p1)
public
Replaces the contents and taintedness of str with the
corresponding values in other_str.
s = "hello"
s.replace "world"
Show source
VALUE
rb_str_replace(VALUE str, VALUE str2)
{
str_modifiable(str);
if (str == str2) return str;
StringValue(str2);
str_discard(str);
return str_replace(str, str2);
}