From: Robert Klemme Date: 2008-07-03T00:12:44+09:00 Subject: Re: Ranges and Enumerable problems 2008/7/2 Glen Holcomb : > Okay so when I play with "!".."~" wrong things happen. > > ("!".."~").include?("W") > true > > ("!.."~").include?(" ") > false > > so far so good, however. > > ("!".."~").each do |c| > puts c > end > > ! > " > # > $ > % > & > ' > ( > ) > * > + > , > - > . > / > 0 > 1 > 2 > 3 > 4 > 5 > 6 > 7 > 8 > 9 > => "!".."~" > > This is wrong! > > ("!".."~").last > => "~" > > This is also right. > > It looks to me like a problem with the Enumerable mixin but I guess the > question is why? Note this irb(main):003:0> "9".succ => "10" Try this instead: (?!..?~).each {|c| p c.chr} irb(main):008:0> (?!..?~).include? ?\ => false Kind regards robert -- use.inject do |as, often| as.you_can - without end