to split a string in javascript code example
Example 1: 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 2: how to saperate string to array
Scanner in=new Scanner(System.in);
String input=in.nextLine();
String[] word=input.split(" ");