However above [duplicate suggestion] is for multidimensional array, not targeting the simpler case I am posing here.
For example if I have:
\'one\',\'two
arr.map(&:length).max -
You can also use:
['one','two','three','four','five'].inject { |f, s| f.length > s.length ? f : s }
Just do as below using Enumerable#max_by :
ar = ['one','two','three','four','five'] ar.max_by(&:length) # => "three"