Here you can find the source of splitFast(String text, char delim)
public static List<String> splitFast(String text, char delim)
//package com.java2s; import java.util.ArrayList; import java.util.List; public class Main { static final char NL_CODE = '\n'; public static List<String> splitFast(String text, char delim) { List<String> result = new ArrayList<String>(); String s = text;// ww w. j av a 2 s . co m while (!s.isEmpty()) { int pos = s.indexOf(delim); if (pos == -1) { result.add(s); break; } else { result.add(s.substring(0, pos)); } s = s.substring(pos + 1); } return result; } public static List<String> splitFast(String s) { if (s != null) { List<String> list = splitFast(s, NL_CODE); return list; } else { return new ArrayList<String>(0); } } }