On Wed, Mar 11, 2009 at 07:49:16PM -0700, Cory Spencer wrote:
+ our Str multi method lcfirst is export {
+ self ?? self.substr(0,1).lc ~ self.substr(1) !! ""
+ }
+
+ our Str multi method ucfirst is export {
+ self ?? self.substr(0,1).uc ~ self.substr(1) !! ""
+ }
We need to be careful about that boolean test for 'self' --
what about things like...
0.ucfirst
('hello' but False).ucfirst
('' but True).ucfirst
I've applied the patch in c48d6a3, after changing the
test on C<self> to C< self gt '' > .
We probably need some spectests to test the edge cases
I've identified above, so I'll leave the ticket open until
that's done.
Thanks for the patch!
Pm