From: Lloyd Linklater Date: 2008-09-18T04:30:03+09:00 Subject: Re: Generating a semi-random, but legal, filename Actually, this might be a bit cleaner: def randomFileNameSuffix (numberOfRandomchars) s = "" numberOfRandomchars.times { s << (65 + rand(26)) } s end puts "foo_" + randomFileNameSuffix(7) + ".txt" => foo_OLNMGZZ.txt Note: the 65 added is the numeric value of "A". rand(26) gives 0..25. So, we add that to a capital "A" to get the random letter. It is rather simple but that is not always a defect. -- Posted via http://www.ruby-forum.com/.