Max on String array : Max « LINQ « C# / C Sharp






Max on String array

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

public class MainClass {
    public static void Main() {
        string[] presidents = {"G", "H", "H", "H", "H", "J"};
        string maxName = presidents.Max();
        Console.WriteLine(maxName);
    }
}

 








Related examples in the same category

1.Max on int array
2.Max on object list
3.Max on Object list array
4.uses Max to get the highest number in an integer array.
5.uses Max to get the length of the longest word in a string array.
6.Grouped Max
7.Get the Min and max value from a query