Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Exists(Int32, Int32, Predicate<Int32>) |
Determines whether a specified test is true for any integer within a range of integers. |
Exists<T>(IEnumerable<T>, Predicate<T>) |
Determines whether an element within a collection of elements exists within a function. |
Determines whether a specified test is true for any integer within a range of integers.
public:
static bool Exists(int fromInclusive, int toExclusive, Predicate<int> ^ predicate);
public static bool Exists(int fromInclusive, int toExclusive, Predicate<int> predicate);
static member Exists : int * int * Predicate<int> -> bool
Public Shared Function Exists (fromInclusive As Integer, toExclusive As Integer, predicate As Predicate(Of Integer)) As Boolean
The first integer to pass to predicate
.
One more than the last integer to pass to predicate
.
The function to evaluate for any value of the integer in the specified range.
true
if predicate
returns true
for any integer starting from fromInclusive
to toExclusive
- 1.
predicate
is null
.
toExclusive
is less than fromInclusive
.
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.
Determines whether an element within a collection of elements exists within a function.
public:
generic <typename T>
static bool Exists(System::Collections::Generic::IEnumerable<T> ^ collection, Predicate<T> ^ predicate);
public static bool Exists<T>(System.Collections.Generic.IEnumerable<T> collection, Predicate<T> predicate);
static member Exists : seq<'T> * Predicate<'T> -> bool
Public Shared Function Exists(Of T) (collection As IEnumerable(Of T), predicate As Predicate(Of T)) As Boolean
The type that is contained in collection
.
The collection from which elements of type T
will be drawn to pass to predicate
.
The function to evaluate for an element in collection
.
true
if and only if predicate
returns true
for any element of type T
in collection
.
collection
or predicate
is null
.
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in