Is there a LINQ function for this is or would one have to code it themselves like this:
LINQ
static string GetLongestStringInList() { string long
To get the longest string in list of object/string try this:
List list = new List(); list.Add("HELLO"); list.Add("HELLO WORLD"); String maxString = list.OrderByDescending(x => x.Length).First();
The variable maxString will contain the value "HELLO WORLD"
maxString
"HELLO WORLD"