List of utility methods to do String Tokenize
String[] | tokenize(String input, String token) tokenize String[] tokens = null; Vector cour = new Vector(); if (input.indexOf(token) != -1) { int startIndex = 0; int endIndex = input.indexOf(token, startIndex); do { String courToken = input.substring(startIndex, endIndex); if (courToken.trim().length() > 0) { ... |
List | tokens(String stringrep, String separatorChars, boolean trim, boolean ignoreBlanks) tokens List<String> l = new ArrayList<String>(); StringTokenizer stz = new StringTokenizer(stringrep, separatorChars); String s = null; while (stz.hasMoreTokens()) { s = stz.nextToken(); if (trim) { s = s.trim(); if (!(ignoreBlanks && TextUtils.isEmpty(s))) l.add(s); return l; |