From: Jamey Cribbs Date: 2004-06-23T04:01:06+09:00 Subject: Re: Newbie question - how to replace multiple whitespace within astring? 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? > > state.squeeze!(" ") Now, how easy is that?! :) Jamey Confidentiality Notice: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. If you are not the intended recipient(s), you are hereby notified that any dissemination, unauthorized review, use, disclosure or distribution of this email and any materials contained in any attachments is prohibited. If you receive this message in error, or are not the intended recipient(s), please immediately notify the sender by email and destroy all copies of the original message, including attachments.