Memory<T>.Slice 方法

定义

重载

名称 说明
Slice(Int32)

形成从指定索引处开始的当前内存的切片。

Slice(Int32, Int32)

从指定长度的指定索引处开始的当前内存中形成切片。

Slice(Int32)

Source:
Memory.cs
Source:
Memory.cs
Source:
Memory.cs
Source:
Memory.cs
Source:
Memory.cs

形成从指定索引处开始的当前内存的切片。

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

参数

start
Int32

开始切片的索引。

返回

一个对象,该对象包含从 start 实例末尾到实例末尾的当前实例的所有元素。

例外

start 小于零或大于 Length

适用于

Slice(Int32, Int32)

Source:
Memory.cs
Source:
Memory.cs
Source:
Memory.cs
Source:
Memory.cs
Source:
Memory.cs

从指定长度的指定索引处开始的当前内存中形成切片。

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

参数

start
Int32

开始切片的索引。

length
Int32

要包括在切片中的元素数。

返回

一个对象,包含 length 从当前实例开始 start的元素。

例外

start 小于零或大于 Length

-或-

length 大于 Length - start

适用于