From: Konrad Meyer Date: 2007-08-18T20:09:16+09:00 Subject: Re: How do you print the first 5 records in an array? --DSPAM_MULTIPART_EX-13582 Content-Type: multipart/signed; boundary="nextPart1398676.4MVO2BJ6Cx"; protocol="application/pgp-signature"; micalg=pgp-sha1 --nextPart1398676.4MVO2BJ6Cx Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 18 August 2007 02:55:17 am Bob Sanders wrote: > Let's say I have an array defined as: >=20 > @people =3D ["Jim", "Jen", "Jess", "Jay", "Jack", "John", "Jeff", "Jed", > "Jill"] >=20 > How would I then print out the first 5 records of that array? (i.e. from > Jim to Jack) >=20 > Any ideas? One idea comes to mind: @people.inject([]){|a,p|a<

http://konrad.sobertillnoon.com/ --nextPart1398676.4MVO2BJ6Cx Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBGxtNhCHB0oCiR2cwRApkrAJ0Vs5pCf5DM9Oos/d/rdH6eqt4YpACgw/dZ gHaqlc4CwQSj3JU+M1JWhAc= =FbuK -----END PGP SIGNATURE----- --nextPart1398676.4MVO2BJ6Cx-- --DSPAM_MULTIPART_EX-13582 Content-Type: text/plain X-DSPAM-Signature: 46c6d363135821228095555 !DSPAM:46c6d363135821228095555! --DSPAM_MULTIPART_EX-13582--