I have my string:
var str = '123\r\nabc';
Which I'd like to produce this array:
["1", "2", "3", "
", "a", "b", "c"]
So, I'm looking to split it by character, but to keep \r\n together as one element in the resulting array.
My failed attempts:
console.log(str.split(/\r\n|/)); // removes \r\n
console.log(str.split(/\r\n/)); // splits by \r\n