Although splitPreserve isn't a great name, I can't thinkn of a better one.
This does seem to be requested functionality for a utils class in addition
to Tokenizer, so +1.

Stephen

----- Original Message -----
From: "Steven Caswell" <[EMAIL PROTECTED]>
Regarding the solution for
http://issues.apache.org/bugzilla/show_bug.cgi?id=22692, in addition to the
fine work on the Tokenizer class, I'd like to address the initial complaint
about how the split methods treat adjacent separators as one separator. I
agree with Juergen that adjacent separators should not be treated this way,
but should return an empty array element for adjacent separators.

I propose to create an additional set of split methods that would preserve
separators. To preserve backward compatibility, I propose it be called
splitPreserve to distinguish from the existing split method. The
functionality would be:

For an input string of "a:b:::d" the return array would be
array[0] = "a"
array[1] = "b"
array[2] = ""
array[3] = ""
array[4] = "d"



Steven Caswell
Sun Certified Java Programmer
[EMAIL PROTECTED]
"War is an ugly thing, but not the ugliest of things. The decayed and
degraded state of moral and patriotic feeling that thinks that nothing is
worth war is much worse. The person who has nothing for which he is willing
to fight, nothing which is more important than his own personal safety, is a
miserable creature and has no chance of being free unless made and kept so
by the exertions of better men than himself." .... John Stuart Mill.




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



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

Reply via email to