From: Scott Briggs Date: 2009-08-05T04:29:24+09:00 Subject: Re: Bizarre Range behavior Ah, I should clarify that. When ruby interprets "11" as an integer 11 for "1".."11", then why doesn't it do the same when it's "2".."11"? Scott Scott Briggs wrote: > Matt, that doesn't explain why "1".."11" works and "2".."11" doesn't > work. > > Scott > > Matthew K. Williams wrote: >> On Wed, 5 Aug 2009, Scott Briggs wrote: >> >>>>> ("2".."11").to_a >>> => [] >>>>> ("1".."11").to_a >>> => ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"] >>> >> >> It's because you're using strings -- "11" comes before "2", hence the >> failure, because it's an invalid range, just as if you had (11 .. 2) is >> invalid. >> >> Matt -- Posted via http://www.ruby-forum.com/.