From: Robert Klemme Date: 2006-08-16T22:50:04+09:00 Subject: Re: string equivalency On 16.08.2006 15:42, Brad Tilley wrote: > What's the best way to check if a string is not exactly what you're > expecting? I'm doing this: > > b = 'brad' > if not b.eql?('bradsdhsh') > puts 'not equal' > else > puts 'equal' > end > > Is there a more proper way to do it? KISS: b = 'brad' if 'bradsdhsh' == b puts 'equal' else puts 'not equal' end Or, as a one liner puts 'bradsdhsh' == b ? 'equal' : 'not equal' HTH robert