From: Xavier Noria Date: 2011-05-24T21:01:29+09:00 Subject: Re: Using sprintf() to print a Hash --90e6ba4fbe80d88c6704a4045854 Content-Type: text/plain; charset=UTF-8 Not sure if I understand correctly, but this seems to do what you are looking for hash.each do |key, value| printf "%-12s %10s\n", "#{key}:", value end Max field widths may be computed for arbitrary hashes. -- fxn PD: Note that I use printf, format is the same as sprintf, but you print the formatted string directly, as in C. --90e6ba4fbe80d88c6704a4045854--