public static String[] split(String value, char delimiter) { char[] valueChars = value.toCharArray();
public static String[] split(String value, String delimiter) {
	public static String[] split(String value, char delimiter) {		char[] valueChars = value.toCharArray();		int lastIndex = 0;		ArrayList strings = null;		for (int i = 0; i < valueChars.length; i++) {			char c = valueChars[i];			if (c == delimiter) {				if (strings == null) {					strings = new ArrayList();				}				strings.add( new String( valueChars, lastIndex, i - lastIndex ) );				lastIndex = i + 1;			}		}		if (strings == null) {			return new String[]{ value };		}		// add tail:		strings.add( new String( valueChars, lastIndex, valueChars.length - lastIndex ) );		return (String[]) strings.toArray( new String[ strings.size() ] );	}