Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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.
Slice(Int32) |
Forms a slice out of the current array segment starting at the specified index. |
Slice(Int32, Int32) |
Forms a slice of the specified length out of the current array segment starting at the specified index. |
Forms a slice out of the current array segment starting at the specified index.
public:
ArraySegment<T> Slice(int index);
public ArraySegment<T> Slice(int index);
member this.Slice : int -> ArraySegment<'T>
Public Function Slice (index As Integer) As ArraySegment(Of T)
The index at which to begin the slice.
An array segment that consists of all elements of the current array segment from index
to the end of the array segment.
The underlying array of this instance is null
.
index
is greater than the length of the underlying array of this instance.
Product | Versions |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Standard | 2.1 |
Forms a slice of the specified length out of the current array segment starting at the specified index.
public:
ArraySegment<T> Slice(int index, int count);
public ArraySegment<T> Slice(int index, int count);
member this.Slice : int * int -> ArraySegment<'T>
Public Function Slice (index As Integer, count As Integer) As ArraySegment(Of T)
The index at which to begin the slice.
The desired length of the slice.
An array segment of count
elements starting at index
.
The underlying array of this instance is null
.
index
is greater than the length of the underlying array of this instance.
-or-
count
is greater than the length of the underlying array of this instance - index
.
Product | Versions |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Standard | 2.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in