ReadOnlyMemory<T>.Slice 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| Slice(Int32) |
从给定的内存区域形成切片,从指定位置开始,然后继续到其末尾。 |
| Slice(Int32, Int32) |
从 |
Slice(Int32)
从给定的内存区域形成切片,从指定位置开始,然后继续到其末尾。
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
开始切片处的索引。
返回
表示所需切片的只读内存区域。
例外
start 小于 0 或大于 Length。
适用于
Slice(Int32, Int32)
从 length 元素的 start 位置开始,在给定内存区域外形成一个切片。
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
开始切片处的索引。
- length
- Int32
切片所需的长度。
返回
表示所需切片的只读内存区域。
例外
start、length 或 start + length 超出了当前实例的范围。