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 Fri, 15 Apr 2011 21:08:10 -0500
Organization Service de news de lacave.net
Lines 16
Message-ID <fd6f7d3388641b7b1873dbce2346c695@ruby-forum.com> (permalink)
NNTP-Posting-Host bristol.highgroove.com
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 7bit
X-Trace talisker.lacave.net 1302919719 83512 65.111.164.187 (16 Apr 2011 02:08:39 GMT)
X-Complaints-To abuse@lacave.net
NNTP-Posting-Date Sat, 16 Apr 2011 02:08:39 +0000 (UTC)
X-Received-From This message has been automatically forwarded from the ruby-talk mailing list by a gateway at comp.lang.ruby. If it is SPAM, it did not originate at comp.lang.ruby. Please report the original sender, and not us. Thanks! For more details about this gateway, please visit: http://blog.grayproductions.net/categories/the_gateway
X-Mail-Count 381677
X-Ml-Name ruby-talk
X-Rubymirror Yes
X-Ruby-Talk <fd6f7d3388641b7b1873dbce2346c695@ruby-forum.com>
Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.stben.net!talisker.lacave.net!lacave.net!not-for-mail
Xref x330-a1.tempe.blueboxinc.net comp.lang.ruby:2984

Show key headers only | 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