Split a String
This tutorial shows how to split a string in Java. Below, we present three options to split a string in Java namely – with StringTokenizer class, with split() method of the String class and with Pattern class. Each of the options has its utility and advantage over the other. You can use either of them as per your need.