in reply to TRIM in Perl?
There's no sub for trimming strings in perl. The best way is probably to just go ahead and bite the bullet:
my $temp = " Hello "; $temp =~ s/^\s+//; $temp =~ s/\s+$//;
You can write your own trim() function to automate this if you wish.
--
perl: code of the samurai
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: TRIM in Perl?
by Aristotle (Chancellor) on Sep 10, 2002 at 16:21 UTC | |
by samurai (Monk) on Sep 12, 2002 at 13:28 UTC |