Method: String#chomp

Defined in:
string.c

#chomp(line_sep = $/) ⇒ Object

:include: doc/string/chomp.rdoc



10211
10212
10213
10214
10215
10216
10217
# File 'string.c', line 10211

static VALUE
rb_str_chomp(int argc, VALUE *argv, VALUE str)
{
    VALUE rs = chomp_rs(argc, argv);
    if (NIL_P(rs)) return str_duplicate(rb_cString, str);
    return rb_str_subseq(str, 0, chompped_length(str, rs));
}