Here you can find the source of Split(String content, String sub_seq)
public static String[] Split(String content, String sub_seq)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; public class Main { public static String[] Split(String content, String sub_seq) { int start_index = 0; ArrayList<String> ret = new ArrayList<String>(); int pos = -1; while (start_index < content.length() && (pos = content.indexOf(sub_seq, start_index)) != -1) { ret.add(content.substring(start_index, pos + sub_seq.length())); start_index = pos + sub_seq.length(); }/*from w ww . j ava 2 s .co m*/ if (start_index < content.length()) { ret.add(content.substring(start_index)); } String[] result = new String[ret.size()]; return ret.toArray(result); } }