in reply to How can I strip an arbitary number of "inner" spaces from a string?

$string="From: Some Text";
$string=~s/\s+//;

\s+ will match one or more occurances of white space
$string =~/\s+//g ;
## global operator g will strip all the white spaces present
  • Comment on Re: How can I strip an arbitary number of "inner" spaces from a string?

Replies are listed 'Best First'.
Re^2: How can I strip an arbitary number of "inner" spaces from a string?
by Aristotle (Chancellor) on Sep 17, 2004 at 07:07 UTC

    That will remove not just runs of multiple blanks, but all blanks in his string.

    Makeshifts last the longest.