Java tutorial
public class Main { public static void main(String[] args) { String str = "string1 & string2 / string3"; String delimiters = " [/&] "; String[] tokensVal = str.split(delimiters); System.out.println("Count of tokens = " + tokensVal.length); for (String token : tokensVal) { System.out.println("#" + token + "#"); } } }