This is checked in now.
Actually today I came across the JSTL method names substringAfter() and
substringBefore(). Maybe these are better names? Of course you'd need
substringAfterLast() and substringBeforeLast(), but maybe its more
expressive than slice. Not sure.
Stephen
----- Original Message -----
From: "Phil Steitz" <[EMAIL PROTECTED]>
To: "Jakarta Commons Developers List" <[EMAIL PROTECTED]>
Sent: Thursday, July 24, 2003 4:39 AM
Subject: Re: [lang] StringUtils.sliceFirstRemainder behavior
> Phil Steitz wrote:
> > [EMAIL PROTECTED] wrote:
> >
> >>> from: Phil Steitz <[EMAIL PROTECTED]>
> >>> I assume you also agree that all slice functions should fix "", null,
> >>> i.e.,
> >>>
> >>> slice[Xxx](null, *) = null,
> >>> slice[Xxx]("", *) = ""
> >>
> >>
> >> Yes, these seem like the simple cases.
> >>
> >> Stephen
> >>
> >
> > OK. Unless there are objections or someone else commits the changes, I
> > will submit a patch this eve (MST, US) to make and document the changes
> > discussed above, i,e,
> >
> > <snip>
> >
> > ("abc", "z") = no match = end of "abc"
> > - slice = "abc"
> > - sliceRemainder = ""
> > - sliceFirst = "abc"
> > - sliceFirstRemainder = ""
> >
> > ("abc", "") = first match at start, last match at end
> > - slice = "abc"
> > - sliceRemainder = ""
> > - sliceFirst = ""
> > - sliceFirstRemainder = "abc"
> >
> > ("abc", null)
> > ??? could mean the same as "", or no match.
> > No match strikes me as the better choice.
> >
> > </snip>
>
> Patch submitted here:
>
> http://issues.apache.org/bugzilla/show_bug.cgi?id=21841
>
> The patch also refactors all of the slice functions to take advantage of
> (and ensure consistency with) StringUtils.indexOf, lastIndexOf.
>
> >
> > Phil
> >
> >
> >
> > Phil
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]