⭐ in reply to How do I remove whitespace at the beginning or end of my string?
Similarly to infinityandbeyond, you could substitute out the leading and trailing white space like this.
$string =~ s/^\s*(.*?)\s*$/$1/;
|
---|
In Section
Seekers of Perl Wisdom