From: "David A. Black" Date: 2009-08-23T21:58:25+09:00 Subject: Re: 1.8.7 String#lines keeps new-line chars (say it ain't so in 1.9) Hi -- On Sun, 23 Aug 2009, Intransition wrote: > Ruby 1.8.7 p72 > > >> "A\nB\nC".lines.to_a > => ["A\n", "B\n", "C"] > > Please, tell me that's a mishap, and not how 1.9 works. I'd expect: > > >> "A\nB\nC".lines.to_a > => ["A", "B", "C"] String#lines is essentially the same as String#each, which is gone in 1.9. You get, instead of #each and friends (Enumerable), a whole toolkit of ways to enumerate through strings: * lines * bytes * chars * codepoints There's no auto-chomping, but there never has been in any string operation I can think of. David -- David A. Black / Ruby Power and Light, LLC / http://www.rubypal.com Q: What's the best way to get a really solid knowledge of Ruby? A: Come to our Ruby training in Edison, New Jersey, September 14-17! Instructors: David A. Black and Erik Kastner More info and registration: http://rubyurl.com/vmzN