commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Elkins <>
Subject [PATCH][lang] Minor clean-up of Strings.split()
Date Fri, 21 Jun 2002 04:45:26 GMT
Hi, all.

The attached patch does two things that IMO make the behavior of 
Strings.split() a little more intuitive.

1. Change the default delimiter to any whitespace from its current 
default of a single space character. This brings split() in line 
with the default behavior of java.util.StringTokenizer and both 
Perl and Python's implementation of split().

2. Instead of using a magic number to indicate "no limit", accept 
any non-positive value to indicate as such. (The patch also adds a 
couple tests for the corner cases).

Christopher Elkins

View raw message