From: Martin DeMello Date: 2010-09-08T21:27:39+09:00 Subject: Re: Small improvements ideas ? On Wed, Sep 8, 2010 at 5:50 PM, Robert Klemme wrote: > On Wed, Sep 8, 2010 at 1:38 PM, Chris wrote: >> Hello, I would like to know how to shorten these two lines >> >> 1) doit() if my_string && my_string.downcase == 'hello' > > doit if /\Ahello\z/i =~ my_string ruby-1.9.2-p0 > /hello/ =~ nil => nil wow, learnt something today! martin