Прочитај на енглеском Уреди

Делите путем


CollectionsMarshal.AsSpan<T>(List<T>) Method

Definition

Gets a Span<T> view over the data in a list. Items should not be added or removed from the List<T> while the Span<T> is in use.

C#
public static Span<T> AsSpan<T>(System.Collections.Generic.List<T>? list);

Type Parameters

T

The type of items in the list.

Parameters

list
List<T>

List from which to create the Span<T>.

Returns

A Span<T> instance over the List<T>.

Applies to

Производ Верзије
.NET 5, 6, 7, 8, 9, 10