Answer the question
In order to leave comments, you need to log in
Splitting a string from a textarea into an array of strings with \n\r?
body-parser parses the textarea value, all into one line like: "Строка1...\r\nСтрока...2\r\n"
Please, this is how I see it from under Windows.
and using split('\r\n') will be fine for win users.
Which method will be universal for all platforms and OS?
Answer the question
In order to leave comments, you need to log in
var s = "Строка1...\r\nСтрока...2\r\n";
var lines = s.split(/\r?\n/);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question