From: Jamey Cribbs Date: 2004-06-23T05:03:30+09:00 Subject: Re: Newbie question - how to replace multiple whitespace withinastring? Brian Tully wrote: >So in these examples I would hope for the following: > > @state = @user['state'].squeeze(" ") > >if @user['state'] was originally "New York" I would hope that the above >would set @state to "New York". > >In addition if @user['state'] was originally "California" I would hope that >the above would still set @state to "California". > > > >squeeze! - Squeezes str in place, returning either str, or nil if no >changes were made. > >I interpret this as if no changes were made "nil" will be returned, so in my >example of "California" wouldn't this set @state to nil? > > > You are correct. 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.