System.Diagnostics.Contracts.Contract.Exists Method

Determines whether a specified test is true for any integer within a range of integers.

Syntax

[System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)]
public static bool Exists (int fromInclusive, int toExclusive, Predicate<int> predicate)

Parameters

fromInclusive
The first integer to pass to predicate.
toExclusive
One more than the last integer to pass to predicate.
predicate
The function to evaluate for any value of the integer in the specified range.

Returns

true if predicate returns true for any integer starting from fromInclusive to toExclusive - 1.

Remarks

The toExclusive parameter is one more than the last integer to facilitate using the length of a range of integers starting at 0. For example, it would be set to 5 for integers 0 through 4.

Requirements

Namespace: System.Diagnostics.Contracts
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 4.0.0.0