public Method

Kernel.chomp!(...)

chomp!              $_ or nil
chomp!(string)      $_ or nil

Equivalent to $_.chomp!(string). See String#chomp!

$_ = "now\n"
chomp!       #=> "now"
$_           #=> "now"
chomp! "x"   #=> nil
$_           #=> "now"

Source Code

/*
*  call-seq:
*     chomp!             => $_ or nil
*     chomp!(string)     => $_ or nil
*  
*  Equivalent to <code>$_.chomp!(<em>string</em>)</code>. See
*  <code>String#chomp!</code>
*     
*     $_ = "now\n"
*     chomp!       #=> "now"
*     $_           #=> "now"
*     chomp! "x"   #=> nil
*     $_           #=> "now"
*/

static VALUE
rb_f_chomp_bang(argc, argv)
   int argc;
   VALUE *argv;
{
   return rb_str_chomp_bang(argc, argv, uscore_get());
}
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.