CSharp - Use Max operator on string array

Description

Use Max operator on string array

Demo

using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
class Program//  ww  w.j  a v a 2  s  .  c  om
{
    static void Main(string[] args)
    {
       string[] codeNames = {"Python", "Java", "Javascript", "Bash", "C++", "Oracle"};

       string maxName = codeNames.Max();
       Console.WriteLine(maxName);
    }
}

Result

Related Topic