Here you can find the source of splitString(String tokenedStr, String token)
public static String[] splitString(String tokenedStr, String token)
//package com.java2s; import java.util.StringTokenizer; public class Main { public static String[] splitString(String tokenedStr, String token) { String[] ids = null;//from w w w. j av a 2s . c o m if (tokenedStr != null) { StringTokenizer st = new StringTokenizer(tokenedStr, token); final int arraySize = st.countTokens(); if (arraySize > 0) { ids = new String[arraySize]; int counter = 0; while (st.hasMoreTokens()) { ids[counter++] = st.nextToken(); } } } return ids; } }