Here you can find the source of split(String text, String token)
public static List split(String text, String token)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.List; public class Main { public static List split(String text, String token) { List list = new ArrayList(); int start = 0; int end = -1; while ((end = text.indexOf(token, start)) != -1) { list.add(text.substring(start, end)); start = end + token.length(); }/*from w ww . j a va 2s . co m*/ list.add(text.substring(start)); return list; } }