SpanExtensions.Any Method

Definition

Namespace: Numerics.NET.Collections
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.2

Overload List

Any<T>(ReadOnlySpan<T>, Func<T, Boolean>) Returns true if at least one of the elements of a span satisfy the specified predicate.
Any<T, TPredicate>(ReadOnlySpan<T>, TPredicate) Returns true if at least one of the elements of a span satisfy the specified 'fast' predicate.

Any<T>(ReadOnlySpan<T>, Func<T, Boolean>)

Returns true if at least one of the elements of a span satisfy the specified predicate.
C#
public static bool Any<T>(
	this ReadOnlySpan<T> span,
	Func<T, bool> predicate
)

Parameters

span  ReadOnlySpan<T>
A read-only span.
predicate  Func<T, Boolean>
The predicate to test the elements of span.

Type Parameters

T
The type of the elements of the span.

Return Value

Boolean
true if at least one of the elements of span satisfy predicate; otherwise false.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ReadOnlySpan<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Any<T, TPredicate>(ReadOnlySpan<T>, TPredicate)

Returns true if at least one of the elements of a span satisfy the specified 'fast' predicate.
C#
public static bool Any<T, TPredicate>(
	this ReadOnlySpan<T> span,
	TPredicate predicate
)
where TPredicate : Object, IFastFunc<T, bool>

Parameters

span  ReadOnlySpan<T>
A read-only span.
predicate  TPredicate
The predicate to test the elements of span.

Type Parameters

T
The type of the elements of the span.
TPredicate
The type of predicate.

Return Value

Boolean
true if at least one of the elements of span satisfy predicate; otherwise false.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ReadOnlySpan<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also