Here you can find the source of split(String candidate)
private static List<String> split(String candidate)
//package com.java2s; /*//from w w w. j a v a 2s . c o m * Geotoolkit - An Open Source Java GIS Toolkit * http://www.geotoolkit.org * * (C) 2012-2013, Geomatys * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ import java.util.ArrayList; import java.util.List; public class Main { private static List<String> split(String candidate) { final List<String> parts = new ArrayList<String>(); int index = candidate.indexOf(':'); while (index > 0) { final String strLenght = candidate.substring(0, index); final int size = Integer.parseInt(strLenght); final String part = candidate.substring(index + 1, index + size + 1); parts.add(part); candidate = candidate.substring(index + size + 1); index = candidate.indexOf(':'); } return parts; } }