From: botp Date: 2011-05-24T21:13:50+09:00 Subject: Re: Using sprintf() to print a Hash On Tue, May 24, 2011 at 7:59 PM, Iņaki Baz Castillo wrote: >... sprintf("  %-20s %20s", "#{key.to_s}:", value.to_s) for simple formatting/justification, i just use the just methods since they are easier (for my brain) to remember. eg, h.each do |k,v| puts k.to_s.ljust(20) + v.to_s.rjust(20) end kind regards -botp