instance method
Kernel#chomp
chomp → $_
chomp(string) → $_
ruby.c
View on GitHub ↗
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;
}
Equivalent to $_ = $_.chomp(<em>string</em>). See String#chomp. Available only when -p/-n command line option specified.