Max on int array : Max « LINQ « C# / CSharp Tutorial






using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;

public class MainClass {
    public static void Main() {
        int[] myInts = new int[] { 974, 2, 7, 1374, 27, 54 };
        int maxInt = myInts.Max();
        Console.WriteLine(maxInt);
    }
}








22.54.Max
22.54.1.Max on int array
22.54.2.Max on String array
22.54.3.Max on object list
22.54.4.Max on Object list array
22.54.5.Using Max to get the highest number in an integer array.
22.54.6.uses Max to get the length of the longest word in a string array.
22.54.7.Grouped Max
22.54.8.Get the Min and max value from a query
22.54.9.Numeric Aggregates: max