Method: Kernel#chomp
- Defined in:
- ruby.c
#chomp ⇒ Object #chomp(string) ⇒ Object
Equivalent to $_ = $_.chomp(string)
. See String#chomp. Available only when -p/-n command line option specified.
1946 1947 1948 1949 1950 1951 1952 |
# File 'ruby.c', line 1946 static VALUE rb_f_chomp(int argc, VALUE *argv, VALUE _) { VALUE str = rb_funcall_passing_block(uscore_get(), rb_intern("chomp"), argc, argv); rb_lastline_set(str); return str; } |