Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- puts "one\ntwo\nthree".lines("\n")
- puts "one\ntwo\nthree".each_line("\n").to_a
- Per, http://ruby-doc.org/core-2.0/String.html#method-i-lines, both of the above are the same.
- The first produces and error while the second works perfectly.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement