From: Douglas Livingstone Date: 2005-04-14T03:29:33+09:00 Subject: Re: newbie question re: variable assignment On 4/13/05, Douglas Livingstone wrote: > > 1.upto(9) do |x| > > puts "#{x}"[0] > > end > > > > You can also use .to_s (convert to string) directly: > > 1.upto(9) { |x| puts x.to_s[0] } > Or even: puts (1..9).collect {|x| x.to_s[0] } Just started playing with #collect yesterday, I like it :) Douglas