how split method works in javascript code example
Example 1: javascript explode
var str = "Well, how, are , we , doing, today";
var res = str.split(",");
Example 2: string split javascript
var myString = "An,array,in,a,string,separated,by,a,comma";
var myArray = myString.split(",");
Example 3: js string to array
var myString = 'no,u';
var MyArray = myString.split(',');
Example 4: 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);
Example 5: Js split method
var String = "Hello World";
var Array = String.split(" ");
console.log(Array);
Example 6: how to saperate string to array
Scanner in=new Scanner(System.in);
String input=in.nextLine();
String[] word=input.split(" ");