TrueForAll(T) Method

Array.TrueForAll(Of T) Method

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

Determines whether every element in the array matches the conditions defined by the specified predicate.

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

Public Shared Function TrueForAll(Of T) ( _
	array As T(), _
	match As Predicate(Of T) _
) As Boolean

Type Parameters


The type of the elements of the array.


Type: T ()
The one-dimensional, zero-based Array to check against the conditions
Type: System.Predicate(Of T)
The Predicate(Of T) that defines the conditions to check against the elements.

Return Value

Type: System.Boolean
true if every element in array matches the conditions defined by the specified predicate; otherwise, false. If there are no elements in the array, the return value is true.


array is Nothing.


match is Nothing.

The Predicate(Of T) is a delegate to a method that returns true if the object passed to it matches the conditions defined in the delegate. The elements of array are individually passed to the Predicate(Of T), and processing is stopped when the delegate returns false for any element.

This method is an O(n) operation, where n is the Length of array.

Windows Phone OS

Supported in: 8.1, 8.0

© 2016 Microsoft