Re: [PATCH] Add .trim method

[email protected] (Ovid) Mon, 12 Jan 2009 05:04:50 -0800 (PST)
Newsgroups perl.perl6.language,perl.perl6.internals
Message-ID <[email protected]>
----- Original Message ----


> >  =item trim
> >
> >      our Str multi Str::trim ( Str $string )
> >
> >  Removes leading and trailing whitespace from a string.
> >
> >  =cut
> >
> > I could optionally make the following work:
> >
> >  $string.trim(:leading<0>);
> >  $string.trim(:trailing<0>);
> >
> > Setting leading or trailing to false (they default to true) would result in 
> either leading or trailing whitespace not being trimmed.  Setting both to false 
> would be a no-op.
> 
> Unless someone protests loudly, I can add this to S29, and I (or
> someone else with tuits) can implement it in Rakudo.

I've already submitted a patch for Rakudo which implements this for the trivial $string.trim and trim($string) case.  The optional :leading and :trailing parameters aren't there.

I'm happy to finish the work according to whatever spec is agreed upon. I want this badly enough that it's important to me :)

 
Cheers,
Ovid
--
Buy the book         - http://www.oreilly.com/catalog/perlhks/
Tech blog            - http://use.perl.org/~Ovid/journal/
Twitter              - http://twitter.com/OvidPerl
Official Perl 6 Wiki - http://www.perlfoundation.org/perl6