commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steven Caswell" <ste...@caswell.name>
Subject RE: [lang] Summarising Purple Was: [lang] Adding Purple to StringUtils
Date Tue, 11 Mar 2003 21:37:24 GMT




> -----Original Message-----
> From: Stephen Colebourne [mailto:scolebourne@btopenworld.com] 
> Sent: Monday, March 10, 2003 6:54 PM
> To: Jakarta Commons Developers List
> Subject: Re: [lang] Summarising Purple Was: [lang] Adding 
> Purple to StringUtils
> 
> 
> From: "Steven Caswell" <steven@caswell.name>
> > From: Alex Chaffee / Purple Technology [mailto:guru@stinky.com] On 
> > Sun, Mar 09, 2003 at 04:05:09PM -0500, Steven Caswell wrote:
> > > > I think "bisect" is good since it explicitly means "two parts" 
> > > > rather than "split" which returns many parts.
> > >
> > > Wouldn't "removeFromLast" describe the action more 
> succiently than 
> > > "bisect" or "divide"?
> >
> > "from" is ambiguous... Which is clearer:
> >
> >   removeAfterLast("my dog has dog fleas", "dog") -> "my dog has "
> >   removeBeforeLast("my dog has dog fleas", "dog") -> " fleas" or
> >   bisectBeforeLast("my dog has dog fleas", "dog") -> "my dog has "
> >   bisectAfterLast("my dog has dog fleas", "dog") -> " fleas"
> >
> > Or is "split" really the right root after all?
> 
> > Or even
> > truncateAfterLast(String)
> > truncateBeforeLast(String)
> 
> I would expect
>  removeAfterLast("my dog has dog fleas", "dog") -> "my dog 
> has dog" ie. to remove the text _after_ the last match.
> 
> Thus, there are four concepts here, not two....
> 
> Maybe:
>  removeAfterLast("my dog has dog fleas", "dog") -> "my dog 
> has dog"  removeFromLast("my dog has dog fleas", "dog") -> 
> "my dog has "  remainderAfterLast("my dog has dog fleas", 
> "dog") -> " fleas"  remainderFromLast("my dog has dog fleas", 
> "dog") -> "dog fleas"
> 

+1 I can live with these

> 
> > > > * toUnderscoreName, toCamelCaseName
> > > >
> > > > I still think these are more functionality than is intended in 
> > > > StringUtils. Would it make sense to put them into a 
> > > > StringConvertUtils?
> >
> > > But there are many "conversion" routines already in 
> StringUtils, so 
> > > this would create an arbitrary and confusing disjunction 
> (confusing 
> > > to those trying to figure out in which class a certain 
> method lies).
> 
> > A good point, and since I don't have much more of an argument, I'll 
> > let it go. I'm fuzzy on where the line is anyway. I just 
> don't want to 
> > see the
> API
> > to get too out of control.
> 
> +1 to StringUtils
> 
> Stephen
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
> 

Steven Caswell
steven@caswell.name
a.k.a Mungo Knotwise of Michel Delving
"One ring to rule them all, one ring to find them..."



---------------------------------------------------------------------
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