develooper Front page | perl.perl5.porters | Postings from May 2021

Re: Revisiting trim

Thread Previous | Thread Next
May 26, 2021 21:14
Re: Revisiting trim
Message ID:
On Wednesday, May 26th, 2021 at 21:55, Uri Guttman <> wrote:

> what about trimmed using context? in a void context it trims in place. in scalar (or non-void) it returns the trimmed string and leaves the input unchanged. only one new function and we use context everywhere so it is familiar.

While I like the idea, we would need to make other methods to have similar behavior:
- lc / uc / ucfirst
- chomp / chop
and probably others.

My 5 cents
Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About