Linq Example 26 - FirstOrDefault With Condition

11:26 PM
Linq Query:

int[] intNums = { 1, 2, 3, 4 };

            var myNums = intNums.FirstOrDefault(s => s == 5);

            Console.WriteLine(myNums);
            

           //Output will be 0 [Not Found]


Output:
0

0 comments:

Post a Comment