From: Chris Hulan Date: 2006-06-23T05:22:28+09:00 Subject: Re: Randomly select an element from an array David Solis wrote: > I have an array: > > [1,2,3,4,5] > > How do I randomly select an element from the array? Array now has built-in random sorting so you could [1,2,3,4,5].sort_by{rand}.last -- Posted via http://www.ruby-forum.com/.