Re: [PATCH] Add .trim method
[email protected] ("Carl Mäsak") Mon, 12 Jan 2009 13:58:09 +0100
| Newsgroups | perl.perl6.language,perl.perl6.internals |
|---|---|
| Message-ID | <[email protected]> |
Ovid (>): > =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. // Carl