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






Get the min element in a range


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

puts range.min           #prints "a"

 








Related examples in the same category

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