From: MrZombie Date: 2010-05-17T23:40:10+09:00 Subject: Re: Range on strings. On 2010-05-17 07:53:34 -0400, Vikrant Chaudhary said: > On May 14, 2:37�pm, Vikrant Chaudhary wrote: >> Hi, >> If I do - >> >> ('A'..'Z').include?('AA') >> >> It returns "true", while >> >> ('A'..'Z').to_a.include?('AA') >> >> (of course) returns "false". 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 > > Probably because the way Strings are compared, "AA" < "Z" #=> true Just for the kicks, I tried with ('a'..'z').include? 'aa' Guess what? False. -- Thank you for your brain. -MrZombie