Don't ask to ask, just ask | |
PerlMonks |
Re: How do I remove whitespace at the beginning or end of my string?by vroom (His Eminence) |
on Jan 21, 2000 at 00:45 UTC ( [id://2259]=note: print w/replies, xml ) | Need Help?? |
Use substitution along with the special characters ^ and $ which match the beginning and end of strings respectively along with \s which matches whitespace;
Edited by davido: Removed useless use of /g modifier.
In Section
Seekers of Perl Wisdom
|
|