ReadOnlyMemory<T>.Slice ReadOnlyMemory<T>.Slice ReadOnlyMemory<T>.Slice ReadOnlyMemory<T>.Slice Method

定义

重载

Slice(Int32) Slice(Int32) Slice(Int32) Slice(Int32)

在给定内存区域外形成一个切片,从指定的位置开始,一直到它的结尾。Forms a slice out of the given memory region, beginning at a specified poisition and continuing to its end.

Slice(Int32, Int32) Slice(Int32, Int32) Slice(Int32, Int32) Slice(Int32, Int32)

length 元素的 start 位置开始,在给定内存区域外形成一个切片。Forms a slice out of the given memory region starting at start position for length elements.

Slice(Int32) Slice(Int32) Slice(Int32) Slice(Int32)

在给定内存区域外形成一个切片,从指定的位置开始,一直到它的结尾。Forms a slice out of the given memory region, beginning at a specified poisition and continuing to its end.

public:
 ReadOnlyMemory<T> Slice(int start);
public ReadOnlyMemory<T> Slice (int start);
member this.Slice : int -> ReadOnlyMemory<'T>
Public Function Slice (start As Integer) As ReadOnlyMemory(Of T)

参数

start
Int32 Int32 Int32 Int32

开始切片处的索引。The index at which to begin this slice.

返回

表示所需切片的只读内存区域。A read-only memory region representing the desired slice.

异常

Slice(Int32, Int32) Slice(Int32, Int32) Slice(Int32, Int32) Slice(Int32, Int32)

length 元素的 start 位置开始,在给定内存区域外形成一个切片。Forms a slice out of the given memory region starting at start position for length elements.

public:
 ReadOnlyMemory<T> Slice(int start, int length);
public ReadOnlyMemory<T> Slice (int start, int length);
member this.Slice : int * int -> ReadOnlyMemory<'T>
Public Function Slice (start As Integer, length As Integer) As ReadOnlyMemory(Of T)

参数

start
Int32 Int32 Int32 Int32

开始切片处的索引。The index at which to begin this slice.

length
Int32 Int32 Int32 Int32

切片所需的长度。The desired length for the slice.

返回

表示所需切片的只读内存区域。A read-only memory region representing the desired slice.

异常

startlengthstart + length 超出了当前实例的范围。start, length, or start + length are outside the range of the current instance.

适用于