Get Min value from string value in CSharp

Description

The following code shows how to get Min value from string value.

Example


using System;//from  w w w . ja va  2 s  . c  o  m
using System.Linq;
using System.Collections;
using System.Collections.Generic;

public class MainClass {
    public static void Main() {
        string[] presidents = {"G", "H", "a", "H", "over", "Jack"};
        string minName = presidents.Min();
        Console.WriteLine(minName);
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    LINQ »




Operator
Select
Where
OrderBy
Group
Join
Let
LINQ