Here you can find the source of split(String input, int separator)
public static List<String> split(String input, int separator)
//package com.java2s; //License from project: LGPL import java.util.*; public class Main { public static List<String> split(String input, int separator) { List<String> retval = new ArrayList<String>(); if (input == null) return retval; int index = 0, end; while (true) { index = input.indexOf(separator, index); if (index == -1) break; index++;//from ww w .j a va 2 s. c om end = input.indexOf(separator, index); if (end == -1) retval.add(input.substring(index)); else retval.add(input.substring(index, end)); } return retval; } }