.split javascript

JavaScript
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);//split into array of strings.
var str = "Well, how, are , we , doing, today";
var res = str.split(",");	var string = "This is an interesting sentence.";
	var response = str.split(" ");
	console.log(response)
	/* Expected result:
    This,is,an,interesting,sentence.
    (Note: returns array)
    */// bad example https://stackoverflow.com/questions/6484670/how-do-i-split-a-string-into-an-array-of-characters/38901550#38901550

var arr = foo.split(''); 
console.log(arr); // ["s", "o", "m", "e", "s", "t", "r", "i", "n", "g"]Split string in javascriptvar str = "How are you doing today?";

var res = str.split(" ");
 
Source

Also in JavaScript: