From: Trans Date: 2009-08-24T06:03:31+09:00 Subject: Re: 1.8.7 String#lines keeps new-line chars (say it ain't so in 1.9) On Aug 23, 8:58 am, "David A. Black" wrote: > 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. String#lines wasn't defined in 1.8.6 so I did not think there was any precedence for it. My use case has always been (as Radoslaw said): "first line\nsecond line\nthird line".split("\n") Wanting my program to read better, I have often defined #lines to do just that. In my experience that's the frequent case. Wanting to keep the separator I think is the lesser need --for which I would be happier with a less concise method name. As it stands #lines does me no good now. "first line\nsecond line\nthird line".lines.map{ |s| s.chomp("\n") } Is even worse than before! ;)