Here you can find the source of split(String s, String at)
static String[] split(String s, String at)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { static String[] split(String s, String at) { List<String> result = new ArrayList<String>(); int i, last = 0; while ((i = s.indexOf(at, last)) != -1) { result.add(s.substring(last, i)); last = i + at.length();/* www .j av a 2 s . c om*/ } result.add(s.substring(last)); return result.toArray(new String[0]); } }