From: Joe Seeley Date: 2006-08-17T01:10:19+09:00 Subject: Re: string equivalency ------=_Part_32385_6637479.1155744616557 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I don't believe it would matter in the case of a String. But it is important to understand the difference. == compares value. eql? compares value and type. In the case of ints versus floats for example 1==1.0 is true, but 1.eql?(1.0) is false. For some classes though, you will see that .eql? is really just syntactic sugar sending to == anyway... On 8/16/06, Brad Tilley wrote: > > > b = 'brad' > > > > if 'bradsdhsh' == b > > puts 'equal' > > else > > puts 'not equal' > > end > > > > Or, as a one liner > > > > puts 'bradsdhsh' == b ? 'equal' : 'not equal' > > This is prefered over the String.eql? method? > > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_32385_6637479.1155744616557--