How to split a string in java?
public class JavaExample{
public static void main(String args[]){
String s = "" ,ab;gh,bc;pq#kk$bb"";
String[] str = s.split(""[,;#$]"");
//Total how many substrings? The array length
System.out.println(""Number of substrings: ""+str.length);
for (int i=0; i < str.length; i++) {
System.out.println(""Str[""+i+""]:""+str[i]);
}
}
}