You can replace \r\n
with something else, then split
by \n
and put back the replaced \r\n
:
'Hello\r\nand World 15.6\n3'.replaceAll('\r\n', '&newline').split('\n').map(item => item.replaceAll('&newline', '\\r\\n'))
CLICK HERE to find out more related problems solutions.