On Tue, 5 Feb 2002, Ho, Tony wrote:

> Is a command in Perl that removes spaces in a String ?
> For example, if I had the following:
>
> my word = "             HELLO    ";

$word =~ s/^\s*//g; #strip leading spaces
$word =~ s/\s*$//g; #strip trailing spaces

-- Brett
                                          http://www.chapelperilous.net/
------------------------------------------------------------------------
Logic doesn't apply to the real world.
                -- Marvin Minsky

Reply via email to