⭐ in reply to How do I remove whitespace at the beginning or end of my string?
One line is just as good.
Credit to perlmonkey for corrections to original post -- Ed.#replace 0 or more whitespaces at the beginning # or 0 or more whitespaces at the end # with nothing $string =~ s/^\s+|\s+$//g;
|
---|
In Section
Seekers of Perl Wisdom