commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@btopenworld.com>
Subject Re: [lang] How should StringUtils.indexOfAny handle "" in search string?
Date Sun, 20 Jul 2003 09:20:52 GMT
----- Original Message -----
From: "Phil Steitz" <phil@steitz.com>
> Currently, StringUtils.indexOfAny(str, searchStrings) returns 0 if
> searchStrings contains "", but we return -1 if it contains null.  Is
> this the way we want it to work? We should add javadoc in any case.

I guess it has to be. String.indexOf("") returns 0. So this just matches
that behaviour.

> One more thing. I really like the examples in the javadoc, but in some
> cases they might be clearer/more complete if we used "*" to indicate
> *any* value (i.e., null, "", "  ", "abc", etc).  For example,
>
> StringUtils.indexOfAny(null, *) = -1
> StringUtils.indexOfAny(*, null) = -1

I think I'm OK with it. The downside is it involves learning a convention.
But I think its probably obvious enough. Any other views?

Stephen

> I am preparing a patch fixing a few small typos/omissions in the
> StringUtils javadoc.  Is it OK if I use this notation?
>
> Phil



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