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

RE: Let's talk about trim() so more

Thread Previous | Thread Next
March 30, 2021 23:58
RE: Let's talk about trim() so more
Message ID:
> I don't understand all the hullaballoo about trim().And I don't get why it ever should be implemented in core.Removing something from the beginning and/or end from some something isa no-brainer in perl.

Trimming is something that is frequently wanted, but though you think it a no-brainer, people don’t always get it right. I found about 7500 distributions with an "inline trim". Here are some of the ones I found:

    s/^\s*//; s/\s+$//;

Not all of those work.

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