From: Andreas Schwarz Date: 2004-06-23T04:03:10+09:00 Subject: Re: Newbie question - how to replace multiple whitespace within a string? Brian Tully wrote: > In PHP I would simply perform an eregi_replace(" ", " ", $state); and in > Perl I would do something like $state =~ s/\s\s/\s/$state; > > How would one accomplish this in Ruby? "New York".gsub(/ /, ' ') => "New York" - or better - "New \t York".gsub(/\s+/, ' ') => "New York"