Span Extensions.To Array<T, U> Method
Applies a function to the elements of a span and returns the result
as an array.
Definition
Namespace: Numerics.NET.Collections
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
C#
An array containing the result of applying function to each element of span.
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
public static U[] ToArray<T, U>(
this ReadOnlySpan<T> span,
Func<T, U> function
)
Parameters
- span ReadOnlySpan<T>
- A read-only span.
- function Func<T, U>
- A function to apply to each element of span.
Type Parameters
- T
- The type of the elements of the span.
- U
- The type of the elements of the result.
Return Value
U[]An array containing the result of applying function to each element of span.