However above [duplicate suggestion] is for multidimensional array, not targeting the simpler case I am posing here.
For example if I have:
'one','two','three','four','five'
I want to select three
as it is the longest string. I tried:
['one','two','three','four','five'].select{|char_num| char_num.size.max}
but Enumerable#max doesn't return the right result.
ruby
tag, at the time of writing – Sheffieldb = ar.map(&:size); ar[b.index(b.max)]
compares withar.max_by(&:size)
. – Slumber