From: "David A. Black" Date: 2007-08-19T02:42:15+09:00 Subject: Re: How do you print the first 5 records in an array? Hi -- On Sun, 19 Aug 2007, Bob Gustafson wrote: > puts @people[0..4].join("\n") Assuming people don't end with "\n", that will have the same effect as doing it without the join: irb(main):007:0> people = %w{ me you him her them } => ["me", "you", "him", "her", "them"] irb(main):008:0> puts people[0..4].join("\n") me you him her them => nil irb(main):009:0> puts people[0..4] me you him her them => nil If they do end with "\n", then they'll be separated by blank lines if you do the join. David -- * Books: RAILS ROUTING (new! http://www.awprofessional.com/title/0321509242) RUBY FOR RAILS (http://www.manning.com/black) * Ruby/Rails training & consulting: Ruby Power and Light, LLC (http://www.rubypal.com)