Use Max operator on string array
using System; using System.Linq; using System.Collections; using System.Collections.Generic; class Program/* ww w .jav a 2 s . com*/ { static void Main(string[] args) { string[] codeNames = {"Python", "Java", "Javascript", "Bash", "C++", "Oracle"}; string maxName = codeNames.Max(); Console.WriteLine(maxName); } }