Linq Example 39 - Max Projection

11:20 PM
Linq Query:

//
            string[] words = { "GodOfWar", "CallOfDuty", "AssasinCreed" };

            int LargestWord = words.Max(w => w.Length);

            Console.WriteLine("The largest word is {0} characters long.", LargestWord);

//


Output:
The largest word is 12 characters long.

0 comments:

Post a Comment