s/\s// will remove ALL spaces. Based on the example below, this may or
may not be the intended result.

$work =~ s/^\s*|\s*$//g;

will remove the leading and trailing spaces, but not spaces embedded in
the string itself, i.e. "    test me  " will become "test me".

-Kevin

On Tue, 2002-02-05 at 13:57, Luciano Favaro wrote:
> You can use:
> 
> word =~ s/\s//;
> 
> Cheers,
> 
> 
> Luciano F�varo.
> 
> "Ho, Tony" wrote:
> 
> > Hi guys
> > Is a command in Perl that removes spaces in a String ?
> > For example, if I had the following:
> >
> > my word = "             HELLO    ";
> >
> > Thanks in advance
> > Tony
> >
> > Tony Ho
> > Lucent Technologies
> > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> >
> >
> >
> 


Reply via email to