From: Robert Klemme Date: 2011-09-13T23:51:25+09:00 Subject: Re: Iterate Array and (pretty)print On Tue, Sep 13, 2011 at 4:40 PM, Larry Lv wrote: > hi, > > u have output @hosts' elements in the block? why would you add a puts in > front of it? > > u can do it just with Array.join > > *puts hosts.join("\n")* You don't even need the join. irb(main):001:0> @hosts = ["test1", "test2", "test3", "test4"] => ["test1", "test2", "test3", "test4"] irb(main):002:0> puts @hosts test1 test2 test3 test4 => nil irb(main):003:0> Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/