Struct ReadOnlySpan<T>
- Namespace
- System
- Assembly
- System.Memory.dll
public readonly ref struct ReadOnlySpan<T>
Type Parameters
T
- Inherited Members
-
- Extension Methods
-
Constructors
ReadOnlySpan(void*, int)
[CLSCompliant(false)]
public ReadOnlySpan(void* pointer, int length)
Parameters
pointer void*
length int
ReadOnlySpan(T[])
public ReadOnlySpan(T[] array)
Parameters
array T[]
ReadOnlySpan(T[], int, int)
public ReadOnlySpan(T[] array, int start, int length)
Parameters
array T[]
start int
length int
Properties
Empty
public static ReadOnlySpan<T> Empty { get; }
Property Value
- ReadOnlySpan<T>
IsEmpty
public bool IsEmpty { get; }
Property Value
- bool
this[int]
public ref readonly T this[int index] { get; }
Parameters
index int
Property Value
- T
Length
public int Length { get; }
Property Value
- int
Methods
CopyTo(Span<T>)
public void CopyTo(Span<T> destination)
Parameters
destination Span<T>
GetEnumerator()
public ReadOnlySpan<T>.Enumerator GetEnumerator()
Returns
- ReadOnlySpan<T>.Enumerator
Slice(int)
public ReadOnlySpan<T> Slice(int start)
Parameters
start int
Returns
- ReadOnlySpan<T>
Slice(int, int)
public ReadOnlySpan<T> Slice(int start, int length)
Parameters
start int
length int
Returns
- ReadOnlySpan<T>
ToArray()
Returns
- T[]
ToString()
public override string ToString()
Returns
- string
TryCopyTo(Span<T>)
public bool TryCopyTo(Span<T> destination)
Parameters
destination Span<T>
Returns
- bool
Operators
operator ==(ReadOnlySpan<T>, ReadOnlySpan<T>)
public static bool operator ==(ReadOnlySpan<T> left, ReadOnlySpan<T> right)
Parameters
left ReadOnlySpan<T>
right ReadOnlySpan<T>
Returns
- bool
implicit operator ReadOnlySpan<T>(ArraySegment<T>)
public static implicit operator ReadOnlySpan<T>(ArraySegment<T> segment)
Parameters
segment ArraySegment<T>
Returns
- ReadOnlySpan<T>
implicit operator ReadOnlySpan<T>(T[])
public static implicit operator ReadOnlySpan<T>(T[] array)
Parameters
array T[]
Returns
- ReadOnlySpan<T>
operator !=(ReadOnlySpan<T>, ReadOnlySpan<T>)
public static bool operator !=(ReadOnlySpan<T> left, ReadOnlySpan<T> right)
Parameters
left ReadOnlySpan<T>
right ReadOnlySpan<T>
Returns
- bool