You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ulrich Mayring <ul...@denic.de> on 2000/03/17 13:39:59 UTC

Replacement for XSPUtil.split

Hello,

the XSPUtil.split method doesn't work the way I expected. Meaning that
if we have this string with a TAB delimiter (\t):

"1\t2\t\t4"

I expected an array of four Strings with the third string empty. Instead
I get an array with only three strings.

It seems this is an issue of the StringTokenizer class that
XSPUtil.split uses. So, I took bits and pieces of the StringTokenizer
class and wrote a very crude and static replacement for XSPUtil.split.
If anyone is interested in the code, please email me.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Softwareentwicklung

Re: Replacement for XSPUtil.split

Posted by Stefano Mazzocchi <st...@apache.org>.
Ulrich Mayring wrote:
> 
> Hello,
> 
> the XSPUtil.split method doesn't work the way I expected. Meaning that
> if we have this string with a TAB delimiter (\t):
> 
> "1\t2\t\t4"
> 
> I expected an array of four Strings with the third string empty. Instead
> I get an array with only three strings.
> 
> It seems this is an issue of the StringTokenizer class that
> XSPUtil.split uses. So, I took bits and pieces of the StringTokenizer
> class and wrote a very crude and static replacement for XSPUtil.split.
> If anyone is interested in the code, please email me.

Yes, I'm interested.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------