Java Language StringTokenizer Split by comma ','


Example

public static void main(String args[]) {
        StringTokenizer st = new StringTokenizer("apple,ball cat,dog", ",");
        while (st.hasMoreTokens()) {
            System.out.println(st.nextToken());
        }
    }

Output:

apple

ball cat

dog