commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz" <p...@steitz.com>
Subject Re: [lang] StringUtils.sliceFirstRemainder behavior
Date Tue, 22 Jul 2003 14:30:40 GMT
Stephen Colebourne wrote:
> I think I would expect:
> 
> StringUtils.slice("foo", "b") = "foo"
> "get everything before the last 'b'"
> 
> StringUtils.sliceRemainder("foo", "b") = ""
> "get everything after the last 'b'"
> 
> StringUtils.sliceFirst("foo", "b") = ""
> "get everything before the first 'b'"
> 
> StringUtils.sliceFirstRemainder("foo", "b") = "foo"
> "get everything after the first 'b'"
> 
> slice and sliceRemainder are opposite.
> The results would be the same for a blank separator.
> 
> But then I don't use Perl which is where I think these came from. 
> So wait to see if you get any more answers!
> 
> Stephen
> 

I just submitted a patch here

http://issues.apache.org/bugzilla/show_bug.cgi?id=21797

that documents current behavior with examples and test cases.

Phil

> ----- Original Message ----- 
> From: "Phil Steitz" <phil@steitz.com>
> To: "Jakarta Commons Developers List" <commons-dev@jakarta.apache.org>
> Sent: Tuesday, July 22, 2003 5:50 AM
> Subject: [lang] StringUtils.sliceFirstRemainder behavior
> 
> 
> 
>>Currently,
>>
>>StringUtils.sliceRemainder("foo", "b") = ""
>>= StringUtils.sliceFirst("foo", "b"),
>>
>>but StringUtils.sliceRemainder("foo", "b") = "foo".
>>
>>Is this the intended behavior?
>>
>>Phil
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>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