Linq Query:
Output:
// Min Projection
string[] words = { "GodOfWar", "CallOfDuty", "AssasinCreed" };
int shortestWord = words.Min(w => w.Length);
Console.WriteLine("The shortest word is {0} characters long.", shortestWord);
//
Output:
The shortest word is 8 characters long.
0 comments:
Post a Comment