From: Robert Klemme Date: 2010-10-31T21:45:12+09:00 Subject: Re: Range of hex values? On 30.10.2010 11:33, Ammar Ali wrote: > In 1.8.[67] the following range does not produce what I expected: > > ("\x00".."\x7F").to_a > > It only produces the characters between \x00 and \x39, while in > 1.9.[12] it produces the full expected range. > I'm curious if this would be considered a bug, intentional, or I'm > missing something? > > A workaround that does the right thing in all versions: > > (0..127).to_a.map {|c| c.chr} The ".to_a" is superfluous here. Here are other options 127.times.map &:chr (0..127).map &:chr Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/