Split string in JavaScript and detect line break - Stack Overflow

Split string in JavaScript and detect line break - Stack Overflow