jodd-core/src/main/java/jodd/util/StringUtil.java
public static String[] split(final String src, final String delimiter) {
		int maxparts = (src.length() / delimiter.length()) + 2;		// one more for the last
		int[] positions = new int[maxparts];
		int dellen = delimiter.length();

		int i, j = 0;
		int count = 0;
		positions[0] = - dellen;
		while ((i = src.indexOf(delimiter, j)) != -1) {
			count++;
			positions[count] = i;
			j = i + dellen;
		}
		count++;
		positions[count] = src.length();

		String[] result = new String[count];

		for (i = 0; i < count; i++) {
			result[i] = src.substring(positions[i] + dellen, positions[i + 1]);
		}
		return result;
	}
public static String[] split(final String src, final String delimiter) {
		int maxparts = (src.length() / delimiter.length()) + 2;		// one more for the last
		int[] positions = new int[maxparts];
		int dellen = delimiter.length();

		int i, j = 0;
		int count = 0;
		positions[0] = - dellen;
		while ((i = src.indexOf(delimiter, j)) != -1) {
			count++;
			positions[count] = i;
			j = i + dellen;
		}
		count++;
		positions[count] = src.length();

		String[] result = new String[count];

		for (i = 0; i < count; i++) {
			result[i] = src.substring(positions[i] + dellen, positions[i + 1]);
		}
		return result;
	}
public static String [ ] split ( final String src , final String delimiter ) { int maxparts = ( src . length ( ) / delimiter . length ( ) ) + 2 ; // one more for the last int [ ] positions = new int [ maxparts ] ; int dellen = delimiter . length ( ) ; int i , j = 0 ; int count = 0 ; positions [ 0 ] = - dellen ; while ( ( i = src . indexOf ( delimiter , j ) ) != - 1 ) { count ++ ; positions [ count ] = i ; j = i + dellen ; } count ++ ; positions [ count ] = src . length ( ) ; String [ ] result = new String [ count ] ; for ( i = 0 ; i < count ; i ++ ) { result [ i ] = src . substring ( positions [ i ] + dellen , positions [ i + 1 ] ) ; } return result ; }
Splits a string in several parts (tokens) that are separated by delimiter.
Delimiter is <b>always</b> surrounded by two strings! If there is no
content between two delimiters, empty string will be returned for that
token. Therefore, the length of the returned array will always be:
#delimiters + 1.
<p>
Method is much, much faster then regexp <code>String.split()</code>,
and a bit faster then <code>StringTokenizer</code>.

@param src       string to split
@param delimiter split delimiter

@return array of split strings
Splits a string in several parts ( tokens ) that are separated by delimiter . Delimiter is <b > always< / b > surrounded by two strings! If there is no content between two delimiters empty string will be returned for that token . Therefore the length of the returned array will always be : #delimiters + 1 . <p > Method is much much faster then regexp <code > String . split () < / code > and a bit faster then <code > StringTokenizer< / code > .