Posted By

jatkins on 07/27/10


Tagged

search array arrays


Versions (?)

Find the longest value in an array


 / Published in: Ruby
 

Public domain.

  1. def find_longest_value(array)
  2. return array.sort { |x,y| y.length <=> x.length }.first
  3. end

Report this snippet  

You need to login to post a comment.