ReadOnlyMemory<T>.Slice 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| 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)
從指定記憶體區域 start 中從元素 length 的位置開始,形成切片。
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 都不在當前實例的範圍內。