Class ReadOnlySpanExtensions
Extension methods for
Inheritance
Namespace: X10D.Linq
Assembly: X10D.dll
Syntax
public static class ReadOnlySpanExtensions : object
Methods
| Improve this Doc View SourceAll<TSource>(ReadOnlySpan<TSource>, Predicate<TSource>)
Determines whether all elements of a read-only span satisfy a condition.
Declaration
public static bool All<TSource>(this ReadOnlySpan<TSource> source, Predicate<TSource> predicate)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<TSource> | source | A |
Predicate<TSource> | predicate | A function to test each element for a condition. |
Returns
Type | Description |
---|---|
System.Boolean | true if every element of the source sequence passes the test in the specified predicate, or if the span is empty; otherwise, false. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements of |
Any<TSource>(ReadOnlySpan<TSource>, Predicate<TSource>)
Determines whether any element of a read-only span satisfies a condition.
Declaration
public static bool Any<TSource>(this ReadOnlySpan<TSource> source, Predicate<TSource> predicate)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<TSource> | source | A |
Predicate<TSource> | predicate | A function to test each element for a condition. |
Returns
Type | Description |
---|---|
System.Boolean | true if the source span is not empty and at least one of its elements passes the test in the specified predicate; otherwise, false. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements of |
Count<TSource>(ReadOnlySpan<TSource>, Predicate<TSource>)
Returns a number that represents how many elements in the specified sequence satisfy a condition.
Declaration
public static int Count<TSource>(this ReadOnlySpan<TSource> source, Predicate<TSource> predicate)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<TSource> | source | A |
Predicate<TSource> | predicate | A function to test each element for a condition. |
Returns
Type | Description |
---|---|
System.Int32 | A number that represents how many elements in the sequence satisfy the condition in the predicate function. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in |