in reply to How do I remove whitespace at the beginning or end of my string?
Remove whitespace at the beginning and end of your string, as well as consecutive whitespace (more than one whitespace character in a row) throughout the string.
$string = join(' ',split(' ',$string));
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Answer: How do I remove whitespace at the beginning or end of my string?
by Abigail-II (Bishop) on Jul 14, 2003 at 15:05 UTC | |
Using a regular expression.
by roju (Friar) on Jul 14, 2003 at 17:06 UTC |
In Section
Seekers of Perl Wisdom