Ruby Newbie homepage Ruby Newbie homepage

How to use

Quick guide

Official content
Returns a copy of self with only the first occurrence (not all occurrences) of the given pattern replaced.
 
               static VALUE
rb_str_sub(int argc, VALUE *argv, VALUE str)
{
    str = str_duplicate(rb_cString, str);
    rb_str_sub_bang(argc, argv, str);
    return str;
}
            

Was this page useful?