Contract.Exists Method (Int32, Int32, Predicate<Int32>)
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Determines whether a specified test is true for any integer within a range of integers.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- fromInclusive
- Type: System.Int32
The first integer to pass to predicate.
- toExclusive
- Type: System.Int32
One more than the last integer to pass to predicate.
- predicate
- Type: System.Predicate<Int32>
The function to evaluate for any value of the integer in the specified range.
Return Value
Type: System.Booleantrue if predicate returns true for any integer starting from fromInclusive to toExclusive - 1.
| Exception | Condition |
|---|---|
| ArgumentNullException | predicate is null. |
| ArgumentException | toExclusive is less than fromInclusive. |
Show: