in reply to Trimming whitespaces methods
Hi harishnuti,
Here is one way, you can use String::Util module to trim leading and trailing spaces in neat way. You do similarly for array elements. TIMTOWTDI
use String::Util ':all'; $val = ' abc '; # "crunch" whitespace and remove leading/trailing whitespace $val = crunch($val); # remove leading/trailing whitespace $val = trim($val); print ">$val<";
Prasad
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Trimming whitespaces methods
by rovf (Priest) on Jul 01, 2008 at 10:10 UTC |
In Section
Seekers of Perl Wisdom