Java tutorial
//package com.java2s; import java.util.StringTokenizer; public class Main { public static String[] parseExtensions(String extensions) { StringTokenizer st = new StringTokenizer(extensions, ","); String[] ext = new String[st.countTokens()]; int i = 0; while (st.hasMoreTokens()) { ext[i++] = st.nextToken(); } return ext; } }