APIdock / Ruby
/
method

chop

ruby latest stable - Class: Kernel
chop()
public

Equivalent to ($_.dup).chop!, except nil is never returned. See String#chop!. Available only when -p/-n command line option specified.

static VALUE
rb_f_chop(void)
{
 VALUE str = rb_funcall_passing_block(uscore_get(), rb_intern("chop"), 0, 0);
 rb_lastline_set(str);
 return str;
}

AltStyle によって変換されたページ (->オリジナル) /