From: Paul McKibbin Date: 2011-03-04T00:05:49+09:00 Subject: Re: Extracting the shortest string from an array --000e0ce0f31694213e049d955b32 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, You could use array.min {|x,y| x.size <=3D> y.size} to force a min to use sizes rather then their natural order Mac On Thu, Mar 3, 2011 at 2:47 PM, I=F1aki Baz Castillo wrote: > Hi, given the following array: > > array =3D ["qwe", "qwerty"] > > How to get the shortest element ("qwe") from the array? > I whink I must inspect all the elements within the array and manually > select the shortest string, do I miss some cool feature of Array class > or Enumerable module? > > Thanks a lot. > > -- > I=F1aki Baz Castillo > > > --000e0ce0f31694213e049d955b32--