This thread is a good entree for my question.  I was adding a new
StringUtils.split method that can split a string using a whole string as the
delimiter, rather than the characters within that string.  In running my JUnit
tests, I discovered unexpected behavior in the existing method:

String stringToSplitOnNulls = "ab   de fg" ;
String[] splitOnNullExpectedResults = { "ab", "de" } ;

String[] splitOnNullResults = StringUtils.split( stringToSplitOnNulls, null, 2
) ;
assertEquals( splitOnNullExpectedResults.length, splitOnNullResults.length ) ;
for ( int i = 0 ; i < splitOnNullExpectedResults.length ; i+= 1 )
{
    assertEquals( splitOnNullExpectedResults[i], splitOnNullResults[i] ) ;
}


The result of the split call is

"ab", "de fg"

and it doesn't look to me like StringTokenizer's documentation implies this
behavior....


Al

=====
Albert Davidson Chou

    Get answers to Mac questions at http://www.Mac-Mgrs.org/ .

__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to