Here you can find the source of splitString(String str, List
private static void splitString(String str, List<String> list, String regex)
//package com.java2s; // %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt import java.util.List; public class Main { private static void splitString(String str, List<String> list, String regex) { int indexOf = str.indexOf(regex); if (indexOf > -1) { list.add(str.substring(0, indexOf)); splitString(str.substring(indexOf + 1, str.length()), list, regex); } else {//from ww w . j av a 2 s . co m list.add(str); } } }