A
Andrea Forlin
@people[0..4].each { |item| puts item }
-----Messaggio originale-----
Da: (e-mail address removed) [mailto:[email protected]] Per conto di
Bob Sanders
Inviato: sabato 18 agosto 2007 11.55
A: ruby-talk ML
Oggetto: How do you print the first 5 records in an array?
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?
-----Messaggio originale-----
Da: (e-mail address removed) [mailto:[email protected]] Per conto di
Bob Sanders
Inviato: sabato 18 agosto 2007 11.55
A: ruby-talk ML
Oggetto: How do you print the first 5 records in an array?
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?