Linq Example 24 - First With Condition

11:20 PM
Linq Query:

            //First Condition
            string[] strDays = { "Monday", "SaturDay", "Monday", "Friday", "TuesDay", "SaturDay" };

            var day = strDays.First(s => s.StartsWith("S"));
            Console.WriteLine(day);
 
            //

Output:
SaturDay

0 comments:

Post a Comment