Exists(T) Method (IEnumerable(T), Predicate(T))
Collapse the table of content
Expand the table of content

Contract.Exists(Of T) Method (IEnumerable(Of T), Predicate(Of T))

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Determines whether an element within a collection of elements exists within a function.

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

'Declaration
Public Shared Function Exists(Of T) ( _
	collection As IEnumerable(Of T), _
	predicate As Predicate(Of T) _
) As Boolean

Type Parameters

T

The type that is contained in collection.

Parameters

collection
Type: System.Collections.Generic.IEnumerable(Of T)
The collection from which elements of type T will be drawn to pass to predicate.
predicate
Type: System.Predicate(Of T)
The function to evaluate for an element in collection.

Return Value

Type: System.Boolean
true if and only if predicate returns true for any element of type T in collection.

ExceptionCondition
ArgumentNullException

collection or predicate is Nothing.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2017 Microsoft