SPUG: multiple spaces in string

Shawn Wagner shawnw at speakeasy.org
Wed Feb 8 10:56:41 PST 2006


On Wed, Feb 08, 2006 at 10:56:41AM -0800, luis medrano wrote:
> List,
> 
> I have to remove multiple spaces between a string. for example:
> 
> "car   crash       in the freeway"
> 
> where you can see is no uniformaty on how the spaces are showing but
> my questions is, how can remove the multiple spaces?


$foo =~ s/\s+/ /g;


-- 
Shawn Wagner
shawnw at speakeasy.org


More information about the spug-list mailing list