Memory<T>.Slice Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Slice(Int32) |
Forms a slice out of the current memory that begins at a specified index. |
Slice(Int32, Int32) |
Forms a slice out of the current memory starting at a specified index for a specified length. |
Slice(Int32)
- Source:
- Memory.cs
- Source:
- Memory.cs
- Source:
- Memory.cs
Forms a slice out of the current memory that begins at a specified index.
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)
Parameters
- start
- Int32
The index at which to begin the slice.
Returns
An object that contains all elements of the current instance from start
to the end of the instance.
Exceptions
start
is less than zero or greater than Length.
Applies to
Slice(Int32, Int32)
- Source:
- Memory.cs
- Source:
- Memory.cs
- Source:
- Memory.cs
Forms a slice out of the current memory starting at a specified index for a specified length.
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)
Parameters
- start
- Int32
The index at which to begin the slice.
- length
- Int32
The number of elements to include in the slice.
Returns
An object that contains length
elements from the current instance starting at start
.