From: Alin Popa Date: 2007-08-19T20:14:56+09:00 Subject: Re: How do you print the first 5 records in an array? Bob Sanders wrote: > Let's say I have an array defined as: > > @people = ["Jim", "Jen", "Jess", "Jay", "Jack", "John", "Jeff", "Jed", > "Jill"] > > How would I then print out the first 5 records of that array? (i.e. from > Jim to Jack) > > Any ideas? 5.times{|t| puts @people[t]} -- Posted via http://www.ruby-forum.com/.