in reply to Re: How do I remove whitespace at the beginning or end of my string?
in thread How do I remove whitespace at the beginning or end of my string?
MRE_regx does not trim whitespace as expected:
$ perl -de 1 Loading DB routines from perl5db.pl version 1.3 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 1 DB<1> $str = ' x '; $str =~ s/^\s+((?:.+\S)?)\s+$/$1/s; DB<2> x $str 0 ' x'
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Answer: How do I remove whitespace at the beginning or end of my string?
by choroba (Cardinal) on Jan 30, 2012 at 09:04 UTC | |
by repellent (Priest) on Jan 31, 2012 at 05:01 UTC |
In Section
Seekers of Perl Wisdom