Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #2984

chomp behaviour

From Steel Steel <angel_steel@ymail.com>
Newsgroups comp.lang.ruby
Subject chomp behaviour
Date 2011-04-15 21:08 -0500
Organization Service de news de lacave.net
Message-ID <fd6f7d3388641b7b1873dbce2346c695@ruby-forum.com> (permalink)

Show all headers | View raw


Using 1.9.1
I noticed something with chomp

$ echo "abc" | ruby -e 'puts gets.chomp("c")'
abc

$ irb
irb(main):001:0> "abc".chomp("c")
=> "ab"

It doesn't work on the command line, or am i doing it wrong.?
comments?

-- 
Posted via http://www.ruby-forum.com/.

Back to comp.lang.ruby | Previous | NextNext in thread | Find similar | Unroll thread


Thread

chomp behaviour Steel Steel <angel_steel@ymail.com> - 2011-04-15 21:08 -0500
  Re: chomp behaviour James <oscartheduck@gmail.com> - 2011-04-15 21:15 -0500
  Re: chomp behaviour Roy Zuo <roylzuo@gmail.com> - 2011-04-15 21:19 -0500
  Re: chomp behaviour Peter Zotov <whitequark@whitequark.org> - 2011-04-15 21:21 -0500
  Re: chomp behaviour Mike Stok <mike@stok.ca> - 2011-04-15 21:23 -0500

csiph-web