From: WATANABE Hirofumi Date: 2003-02-09T04:25:54+09:00 Subject: Re: assembling a string of characters? Hi, Meinrad Recheis writes: > how to create a string from variables containing numeric values of range > 0..255? > > print "\32\32\32" # => ' ' > > #i tried the following: > a = 32 > "\\#{a}"*3 # => '\32\32\32' > > now i would like to let ruby process the result again to get the desired > result ' '. % irb >> a = 32 => 32 >> a.chr * 3 => " " >> format("%c", a) * 3 => " " >> ("%c" % a) * 3 => " " >> ([a].pack "c") * 3 => " " -- eban