The java string split() method splits this string against given regular expression and returns a char array.
public String split(String regex) and,
public String split(String regex, int limit)
Paramater
regex : regular expression to be applied on string.
limit : limit for the number of strings in array. If it is zero, it will returns all the strings matching regex.
Example
String string = "Query-Home";
String[] parts = string.split("-");
String part1 = parts[0]; // Query
String part2 = parts[1]; // Home