Here you can find the source of split(String toSplit)
public static List<String> split(String toSplit)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static List<String> split(String toSplit) { return split(toSplit, null, false); }/*from w w w.ja v a 2s.c o m*/ public static List<String> split(String toSplit, String delims) { return split(toSplit, delims, false); } public static List<String> split(String toSplit, String delims, boolean splitByRegex) { if (toSplit == null) return null; StringTokenizer st = null; List<String> toRet = null; if (!splitByRegex) { toRet = new ArrayList<String>(); if (delims != null) st = new StringTokenizer(toSplit, delims); else st = new StringTokenizer(toSplit); while (st.hasMoreTokens()) { toRet.add(st.nextToken().trim()); } } else { String[] array = toSplit.split(delims); toRet = new ArrayList<String>(Arrays.asList(array)); } return toRet; } }