SpanExtensions Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Helpers for working with the Span<T> type.
public static class SpanExtensions
type SpanExtensions = class
Public Module SpanExtensions
- Inheritance
-
SpanExtensions
Methods
AsBytes<T>(Span<T>) |
Casts a Span<T> of one primitive type |
Cast<TFrom,TTo>(Span<TFrom>) |
Casts a Span<T> of one primitive type |
Count<T>(Span<T>, T) |
Counts the number of occurrences of a given value into a target Span<T> instance. |
DangerousGetReference<T>(Span<T>) |
Returns a reference to the first element within a given Span<T>, with no bounds checks. |
DangerousGetReferenceAt<T>(Span<T>, Int32) |
Returns a reference to an element at a specified index within a given Span<T>, with no bounds checks. |
Enumerate<T>(Span<T>) |
Enumerates the items in the input Span<T> instance, as pairs of reference/index values.
This extension should be used directly within a
The compiler will take care of properly setting up the |
GetDjb2HashCode<T>(Span<T>) |
Gets a content hash from the input Span<T> instance using the Djb2 algorithm. For more info, see the documentation for GetDjb2HashCode<T>(ReadOnlySpan<T>). |
IndexOf<T>(Span<T>, T) |
Gets the index of an element of a given Span<T> from its reference. |
Tokenize<T>(Span<T>, T) |
Tokenizes the values in the input Span<T> instance using a specified separator.
This extension should be used directly within a
The compiler will take care of properly setting up the |