I assume the following characters are newlines
- \ r followed by \ n
- \ n followed by \ r
- \ n is present separately
- \ r is present separately
Use
var re=/\r\n|\n\r|\n|\r/g; arrayofLines=lineString.replace(re,"\n").split("\n");
for an array of all rows, including empty ones.
OR
Use
arrayOfLines = lineString.match(/[^\r\n]+/g);
For an array of non-empty strings
Arup Hore Aug 29 '13 at 16:11 2013-08-29 16:11
source share