Get the max element in a range : Range Min Max « Range « Ruby






Get the max element in a range


range = "a".."e"         #creates "a", "b", "c", "d", "e"

puts range.max           #prints "e"

 








Related examples in the same category

1.Get the min element in a range
2.The range min and max methods return the first and last elements in an array: