You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Ash .." <eq...@hotmail.com> on 2003/12/08 11:45:56 UTC
[lang] StringUtils.split() functionality wrt separator repeats
The StringUtils.split(), suggest as an alternative to StringTokenizer,
ignores adjacent separators.
However, I feel that it would be better if they were not ignored, and empty
strings be returned when such a case occurs. Or, there be an overloaded
option which lets the user specify whether to ignore separator repeats or
not.
As I see it, it is more often that a separator repeat occurs due to the
absence of data in a specified series of, say, cells. Taking the typical
case of a CSV file line read, finding two commas would mean a cell is empty,
not that the resultant array should have one element less. It must rather
have the expected number of elements with the repeat case entailing an empty
String.
Comments.
Ash
---------------------------------------------
Run, rabbit run.
Dig that hole, forget the sun,
And when at last the work is done
Don't sit down it's time to dig another one.
_________________________________________________________________
Use MSN Messenger to send music and pics to your friends
http://www.msn.co.uk/messenger
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org