From: Paul Brannan Date: 2001-10-31T00:21:31+09:00 Subject: [ruby-talk:23853] Re: String#each_line On Tue, 30 Oct 2001, David Alan Black wrote: > Weirdly, it works if you use '' instead of "". I think that's because: ruby -e '"1\n2\n\n3\n4".each('') {|s| p s}' is really: ruby -e '"1\n2\n\n3\n4".each('<------>') {|s| p s}' (the two pieces are pasted together on the command line). So that's the same as: ruby -e '"1\n2\n\n3\n4".each() {|s| p s}' This is evident if you try the same in irb: [pbrannan@zaphod ruby-1.6.5]$ irb irb(main):001:0> "1\n2\n\n3\n4".each('') {|s| p s} "1\n2\n\n" "3\n4" "1\n2\n\n3\n4" irb(main):002:0> Paul