All Operator
The All operator checks whether all elements of a sequence satisfy a condition.
This sample uses All to determine whether an array contains only odd numbers.
| using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication4 bool onlyOdd = numbers.All(n => n % 2 == 1); Console.WriteLine("The list contains only odd numbers: {0}", onlyOdd); Console.ReadLine(); |
Output:
Aspnet Discussion
- - Web application
- - Great Indian Developer Su
- - Aspx page inside Silverli
- - Open aspx page inside Sil
- - Guidance for a novice





