Android examples for java.lang:String Split
Split string to Array by delimiter
import java.util.StringTokenizer; public class Main{ /**//from w w w . j a v a2 s .co m * * @param original * @return */ public static String[] toArray(String original, String delimiter) { if (original == null || original.length() == 0) { return null; } StringTokenizer st = new StringTokenizer(original, delimiter); String[] kws = new String[st.countTokens()]; int i = 0; while (st.hasMoreTokens()) { String s = st.nextToken(); kws[i++] = s; } return kws; } }