Here you can find the source of splitUsingIndexOf(String splittee, String splitter)
public static String[] splitUsingIndexOf(String splittee, String splitter)
//package com.java2s; import java.util.*; public class Main { public static String[] splitUsingIndexOf(String splittee, String splitter) { ArrayList<String> list = new ArrayList<String>(); splittee += " " + splitter; int pos = 0, end; while ((end = splittee.indexOf(splitter, pos)) >= 0) { list.add(splittee.substring(pos, end).trim()); pos = end + 1;/*from w ww . j a v a 2 s . c om*/ } String[] result = new String[list.size()]; for (int i = 0; i < result.length; i++) { result[i] = list.get(i); } return result; } }