Advertisement
Guest User

Ruby - Bug? - String#lines

a guest
May 28th, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.23 KB | None | 0 0
  1. puts "one\ntwo\nthree".lines("\n")
  2. puts "one\ntwo\nthree".each_line("\n").to_a
  3.  
  4. Per, http://ruby-doc.org/core-2.0/String.html#method-i-lines, both of the above are the same.
  5. The first produces and error while the second works perfectly.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement