split with in javascript code example
Example 1: javascript explode
//split into array of strings.
var str = "Well, how, are , we , doing, today";
var res = str.split(",");
Example 2: javascript split
var arr = ['hey', 'nay', 'wey'];
var let = arr.split(' ');
console.log(let);
Example 3: 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);