Given these two strings:
var a = "November 5, 1916";
var b = "October 5–10, 1592";
I am doing:
b.replace(' ', '').split(' ');
a.replace(' ', '').split(' ');
But I still get a comma and no white space. I need to be able to remove ALL commas from those strings and keep the white space in order to have:
var resultA = "November 5 1916";
var resultB = "October 5–10 1592";
update
I do need the split()
afterwards as I need each string in an array.