how to split a string with spaces code example
Example 1: space seperator in string in java
String[] splitted = "peter,james,thomas".split(",");
Example 2: splitting by white space or multiple white spaces
$("#searchquery").text().split(/\s+/);
String[] splitted = "peter,james,thomas".split(",");
$("#searchquery").text().split(/\s+/);