You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2003/11/22 08:08:58 UTC
DO NOT REPLY [Bug 24911] New: -
last substring returned by StringUtils.split( String, String, int ) is too long
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24911>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24911
last substring returned by StringUtils.split( String, String, int ) is too long
Summary: last substring returned by StringUtils.split( String,
String, int ) is too long
Product: Commons
Version: unspecified
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: Other
Component: Lang
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: HotFusionMan@Yahoo.com
My expectations for the behavior of the split( *, ..., int max ) methods don't
match their actual behavior. I expected to get a maximum of "max" substrings,
all of which were delimited in the parent string by the specified delimiters.
Instead, what you get is "max - 1" such substrings, plus the rest of the parent
string as the final result substring. This behavior seems counter to what
StringTokenizer would do, which is surprising, given the Javadoc comments about
using the split methods as alternatives to StringTokenizer.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org