Here you can find the source of extractStrings(String s)
public static List extractStrings(String s)
//package com.java2s; import java.util.*; public class Main { private static char STRING_SEPARATOR = ':'; public static List extractStrings(String s) { List strings = new ArrayList(); if (s == null || s.equals("")) { return strings; }//www . j av a 2s . co m try { while (s.indexOf(STRING_SEPARATOR) != -1) { int nIndex = s.indexOf(STRING_SEPARATOR); strings.add(s.substring(0, nIndex)); s = s.substring(nIndex + 1); } strings.add(s); } catch (IndexOutOfBoundsException ioobe) { // never mind. } return strings; } }