commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ASHWIN Suresh <a.sur...@sigmatel.net.ma>
Subject RE: [lang] StringUtils.split() functionality wrt separator repeat s
Date Mon, 08 Dec 2003 21:43:42 GMT
Then we could perhaps provide an overload which allows the client to choose.
That way, one need not 
resort to a method call for one type and using a clss for the other.
We could improve the balance by offering both choices in the same method :)
Ash



> -----Original Message-----
> From: Stephen Colebourne [mailto:scolebourne@btopenworld.com]
> Sent: Monday, December 08, 2003 21:49
> To: Jakarta Commons Developers List
> Subject: Re: [lang] StringUtils.split() functionality wrt separator
> repeats
> 
> 
> Because we intend to not change the contract of split on 
> StringUtils, that
> method is left as it. Tokenizer provides the alternative. It seems a
> reasonable balance.
> 
> Stephen
> 
> 
> ----- Original Message -----
> From: "Ash .." <equinus100@hotmail.com>
> > I had come across the Tokenizer class in the lang package, 
> and I agree
> that
> > it offers much more control and flexibility. Here however, from a
> > developer's perspective, I had meant to discuss the 
> functionality of the
> > StringUtils.split() method, regardless of such 
> functionality available
> > elsewhere.
> >
> > Ash
> >
> >
> >
> > >-----Original Message-----
> > >From: Inger, Matthew [mailto:inger@Synygy.com]
> > >
> > >try the new "Tokenizer" class.  You can get it from CVS.
> >
> >
> > -----Original Message-----
> > From: Ash .. [mailto:equinus100@hotmail.com]
> > Subject: [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.
> >
> > _________________________________________________________________
> > On the move? Get Hotmail on your mobile phone
> http://www.msn.co.uk/msnmobile
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message