Method: String#chomp

Defined in:
string.c

#chomp(line_sep = $/) ⇒ Object

:include: doc/string/chomp.rdoc



10207
10208
10209
10210
10211
10212
10213
# File 'string.c', line 10207

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));
}