split string by space and colon javascript code example
Example 1: javascript split string into array by comma and space
input.split(/[ ,]+/); //splits string using RegEx on a space OR a comma
Example 2: in javascript how to split string
var str = 'It iS a 5r&e@@t Day.'
var array = str.split(" ");
print(array);
var str = 'It iS a 5r&e@@t Day.'
var array = str.split(" ",2);
print(array);