Here you can find the source of splitToken(String str, String delimiter)
public static List<String> splitToken(String str, String delimiter)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.List; public class Main { public static List<String> splitToken(String str, String delimiter) { List<String> result = new ArrayList<String>(); int delimiterIndex = str.indexOf(delimiter); if (delimiterIndex < 0) { result.add(str);//from w w w . j a va 2 s.c o m } else { result.add(str.substring(0, delimiterIndex)); result.addAll(splitToken( str.substring(delimiterIndex + delimiter.length()), delimiter)); } return result; } }