Ruby Newbie homepage Ruby Newbie homepage

How to use

Quick guide

Official content
Modifies str in place as described for String#chomp, returning str, or nil if no modifications were made.
 
               static VALUE
rb_str_chomp_bang(int argc, VALUE *argv, VALUE str)
{
    VALUE rs;
    str_modifiable(str);
    if (RSTRING_LEN(str) == 0) return Qnil;
    rs = chomp_rs(argc, argv);
    if (NIL_P(rs)) return Qnil;
    return rb_str_chomp_string(str, rs);
}
            

Was this page useful?