StringTokenizer tokenizer= new StringTokenizer(patterns, separator); String[] result= new String[tokenizer.countTokens()]; for (int i= 0; i < result.length; i++) result[i]= tokenizer.nextToken().trim(); return result;
StringTokenizer tokenizer= new StringTokenizer(patterns, separator, true); int tokenCount= tokenizer.countTokens(); List result= new ArrayList(tokenCount); boolean escape= false; boolean append= false; while (tokenizer.hasMoreTokens()) { String token= tokenizer.nextToken().trim(); if (separator.equals(token)) { if (!escape) escape= true; else { addPattern(result, separator); append= true; } } else  { if (!append) result.add(token); else addPattern(result, token); append= false; escape= false; } } return (String[])result.toArray(new String[result.size()]);
	public static String[] convertFromString(String patterns, String separator) {		StringTokenizer tokenizer= new StringTokenizer(patterns, separator);		String[] result= new String[tokenizer.countTokens()];		for (int i= 0; i < result.length; i++)			result[i]= tokenizer.nextToken().trim();		return result;	}