java.lang.String.split();
Usage:
The array returned by this method contains each substring of this string that is terminated by another substring that matches the given expression or is terminated by the end of the string. The substrings in the array are in the order in which they occur in this string. If the expression does not match any part of the input then the resulting array has just one element, namely this string.
org.apache.commons.lang.StringUtils.splitPreserveAllTokens();
Usage:
Splits the provided text into an array, separator specified, preserving all tokens, including empty tokens created by adjacent separators. This is an alternative to using StringTokenizer.
Read more: kickjava_src_apache_StringUtils
and String.split()
uses the final class Pattern
to split.
Pattern.compile(regex).split(this , limit);
in StringUtils uses splitWorker(String str, char separatorChar, boolean preserveAllTokens)
, it's own method, which is a Performance tune for 2.0 (JDK1.4).