Source Code:
(back to article)
Submit
Result:
Report an issue
import java.util.StringTokenizer; public class StringTokenizerExample { public static void main(String[] args) { String url = "http://www.w3docs.com/learn-javascript.html"; StringTokenizer multiTokenizer = new StringTokenizer(url, "://.-"); while (multiTokenizer.hasMoreTokens()) { System.out.println(multiTokenizer.nextToken()); } } }