I am trying to split a sentence using a string as a delimiter.
String sentence = "Java and Python are programming language. Unix and Windows are operating systems."
StringTokenizer tokens = new StringTokenizer(sentence, "and");
expected output is
Java
Python are programming language. Unix
Windows are operating systems.
But split occurs for each and every characters mentioned as a delimiter. Is there any way to use the string directly to split the sentence? also is there any way to use multiple strings as a delimiter?