Returns the maximum value in a sequence.
Syntax
source.Max(selector?)Example
Enter values below to update the example in real time.
var→numbers→new→List→Console→WriteLine→var numbers = new List<int> { 1, 3, 2, 5, 4 };
Console.WriteLine(numbers.Max()); // 5