From: Benoit Daloze Date: 2010-05-10T05:56:44+09:00 Subject: Re: Strings iteration Hi, You could also use this one liner in ruby-1.9.2(r > 27352), if both range are identical: ('01'..'03').to_a.repeated_permutation(2) { |x,y| puts "aa#{x}bb#{y}" } aa01bb01 aa01bb02 aa01bb03 aa02bb01 aa02bb02 aa02bb03 aa03bb01 aa03bb02 aa03bb03 I agree the obvious and flexible solution is still the 2 nested a.upto(b) tough ( or (a..b).each{} ). Regards, B.D.