Here you can find the source of split(final String line, final char delimiter, final List
public static void split(final String line, final char delimiter, final List<String> parts)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { public static void split(final String line, final char delimiter, final List<String> parts) { parts.clear();/*from ww w.ja v a 2s. c o m*/ int start = 0; while (start <= line.length()) { int end = line.indexOf(delimiter, start); if (end < 0) { end = line.length(); parts.add(line.substring(start)); } else { parts.add(line.substring(start, end)); } start = end + 1; } } }