From: Robert Klemme Date: 2004-11-11T20:08:32+09:00 Subject: Re: array.each restart when array is changed "Shashank Date" schrieb im Newsbeitrag news:4192B183.3070204@everestkc.net... > Kevin B�rgens wrote: > > Second question: > > why is this not allowed > > Because 'a' does not automagically cast to Fixnum. > You have to do 'a'[0] to do that and .chr to get back the > character. > > > #show me the first n letters of the alphabet > > ('a'...'a'+gets.to_i).each{|e| puts e } > > Try this: > > ('a'[0]...'a'[0]+gets.to_i).each{|e| puts e.chr} >> (?a ... ?a+10).each {|c| puts c.chr} a b c d e f g h i j => 97...107 Regards robert