--- Lo�c_P�ron <[EMAIL PROTECTED]> wrote:
> I just saw Basename.java has wrong behaviour against suffix removal
> which I corrected:
>
> - int pos = value.indexOf('.');
> + int pos = value.lastIndexOf(suffix);
>
> At first, as it is removing a _suffix_, it must use lastIndexOf()
> instead of indexOf(): there would have been problems with file.tar.gz
> for example.
Quite right -- just didn't know about lastIndexOf() back then. I'll fix
it.
> Then, as the complete suffix is supplied, this suffix should be
> removed instead of relying on a '.' suffix separator.
Well, the idea was (and the doc states) that you don't need to specify the
".", since from my perspective, that's what defines a suffix. But I
suppose if people wanted to specify a "suffix" that was, say, _suffix
instead of .suffix, then yeah, it'd need to get the last index of "suffix"
instead of ".". It'd mean people would have to include the "." in the
'suffix' attribute, though, and that would break it for anyone already
relying on it being added for them. I suppose I could add a new attribute
(eg., 'delimiter') that defaults to ".".
Diane
=====
([EMAIL PROTECTED])
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>