Here you can find the source of tokenize(String str, String delims, boolean returnDelims)
public static List<String> tokenize(String str, String delims, boolean returnDelims)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static List<String> tokenize(String str, String delims, boolean returnDelims) { List<String> list = new ArrayList<String>(); if (str != null && str.length() > 0) { StringTokenizer tok = (delims == null ? new StringTokenizer(str) : new StringTokenizer(str, delims, returnDelims)); while (tok.hasMoreTokens()) { list.add(tok.nextToken()); }//from w w w.j a v a2s .c om } return list; } }