<PackageReference Include="System.Memory" Version="4.6.0" />

System.ReadOnlySpan<T>

public struct ReadOnlySpan<T>
ReadOnlySpan represents a contiguous region of arbitrary memory. Unlike arrays, it can point to either managed or native memory, or to memory allocated on the stack. It is type- and memory-safe.
namespace System { public readonly ref struct ReadOnlySpan<T> { public ref struct Enumerator { public ref T Current { get; } public bool MoveNext(); } public int Length { get; } public bool IsEmpty { get; } public static ReadOnlySpan<T> Empty { get; } [System.Runtime.CompilerServices.IsReadOnly] public ref T this[int index] { [MethodImpl(MethodImplOptions.AggressiveInlining)] [return: System.Runtime.CompilerServices.IsReadOnly] get; } public static bool operator !=(ReadOnlySpan<T> left, ReadOnlySpan<T> right); public static implicit operator ReadOnlySpan<T>(T[] array); public static implicit operator ReadOnlySpan<T>(ArraySegment<T> segment); public Enumerator GetEnumerator(); public ReadOnlySpan(T[] array); public ReadOnlySpan(T[] array, int start, int length); public unsafe ReadOnlySpan(void* pointer, int length); public ref T GetPinnableReference(); public void CopyTo(Span<T> destination); public bool TryCopyTo(Span<T> destination); public static bool operator ==(ReadOnlySpan<T> left, ReadOnlySpan<T> right); public ReadOnlySpan<T> Slice(int start); public ReadOnlySpan<T> Slice(int start, int length); public T[] ToArray(); } }