Ruby Newbie homepage Ruby Newbie homepage

How to use

Quick guide

Official content
Replaces the contents of self with the contents of other_string:
s = 'foo'        # => "foo"
s.replace('bar') # => "bar"
 
               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);
}
            

Was this page useful?