In single quotes, Ruby around the string means that escape characters are not interpreted. Unlike C, where single quotes indicate a single character. In this case, '\n' actually equivalent to "\\n" .
So, if you want to split by \n , you need to change your code to use double quotes.
.split("\n")
jbr May 6 '13 at 20:12 2013-05-06 20:12
source share