commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Yandell <bay...@generationjava.com>
Subject Re: [lang] StringUtils Questions and Suggestions
Date Wed, 05 Mar 2003 19:02:17 GMT


On Wed, 5 Mar 2003, Alex Chaffee / Purple Technology wrote:

>
> In reviewing StringUtils in preparing to integrate my Purpletech code,
> I discovered some inconsistencies and came up with the following
> questions and suggestions:
>
> * Rename overlayString to overlay (to be consistent with other method
>   names, and more concise)

+1 [the Apache yea].

Will deprecate this in the next release.

> * It would be great if many the methods could be written to work on a
>   PrintWriter as well as just creating and returning a string

Ditto for char[] and StringBuffer. Problem is, how to implement this.
We either end up with 3 bad performance and 1 good performant class, or we
have lots of redundant code.

> * Um, what's the difference between mid() and substring()?

It seems to just be that you specify length in mid. Bit too much of
overkill I agree.

> * And why isn't strip*() called trim*()?

trim implies whitespace, whereas strip is any character. That was my only
reason for not naming it the same originally.

> * chomp() and chop() have slightly (but significantly!) different
>   semantics than in Perl.  It would be great if StringUtils behaved in
>   line with expectations.

Yeah, they evolved after I copied them from the php description [having
liked them previously in perl].

I'm a bit too close to the StringUtils versions now though, care to
highlight the differences?

Thanks,

Hen


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