split a string with, code example
Example 1: javascript string to array
const str = 'Hello!';
const arr = Array.from(str);
//[ 'H', 'e', 'l', 'l', 'o', '!' ]
Example 2: how to saperate string to array
Scanner in=new Scanner(System.in);
String input=in.nextLine();
String[] word=input.split(" ");