From: Josh Cheek Date: 2010-05-16T03:08:48+09:00 Subject: Re: Range on strings. --0016e6d77e32f249be0486a5e184 Content-Type: text/plain; charset=ISO-8859-1 On Sat, May 15, 2010 at 8:25 AM, MrZombie wrote: > On 2010-05-14 05:37:37 -0400, Vikrant Chaudhary said: > > Is it intentional or possibly a bug? >> I'm using ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux] on >> Ubuntu 10.04 x64 >> > > Mac OS X Snow Leopard running Ruby 1.9.1, same behavior. > > I notice that it returns false if no element of the string is included in > the range. > > For example, given r = ('A'..'Z'): r.include?('RUBY') # returns true > and: r.include?('Ruby') # also true > but: r.include?('ruby') # is false. > -- > Thank you for your brain. > -MrZombie > > > I am not able to replicate that behaviour. $ rvm use 1.9.1 Using ruby 1.9.1 p378 $ irb ruby-1.9.1-p378 > r = 'A'..'Z' => "A".."Z" ruby-1.9.1-p378 > r.include? 'Ruby' => false ruby-1.9.1-p378 > r.include? 'RUBY' => false ruby-1.9.1-p378 > r.include? 'ruby' => false ruby-1.9.1-p378 > exit $ ruby -v ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-darwin10.3.0] --0016e6d77e32f249be0486a5e184--