split single and double whitespace code example
Example 1: splitting by white space or multiple white spaces
$("#searchquery").text().split(/\s+/);
Example 2: splitting by white space or multiple white spaces
$("#searchquery").text().split(/ +/);