Span<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 span that begins at a specified index. |
Slice(Int32, Int32) |
Forms a slice out of the current span starting at a specified index for a specified length. |
Slice(Int32)
- Source:
- Span.cs
- Source:
- Span.cs
- Source:
- Span.cs
Forms a slice out of the current span that begins at a specified index.
public:
Span<T> Slice(int start);
public Span<T> Slice (int start);
member this.Slice : int -> Span<'T>
Public Function Slice (start As Integer) As Span(Of T)
Parameters
- start
- Int32
The index at which to begin the slice.
Returns
A span that consists of all elements of the current span from start
to the end of the span.
Exceptions
start
is less than zero or greater than Length.
Applies to
Slice(Int32, Int32)
- Source:
- Span.cs
- Source:
- Span.cs
- Source:
- Span.cs
Forms a slice out of the current span starting at a specified index for a specified length.
public:
Span<T> Slice(int start, int length);
public Span<T> Slice (int start, int length);
member this.Slice : int * int -> Span<'T>
Public Function Slice (start As Integer, length As Integer) As Span(Of T)
Parameters
- start
- Int32
The index at which to begin this slice.
- length
- Int32
The desired length for the slice.
Returns
A span that consists of length
elements from the current span starting at start
.
Exceptions
start
or start
+ length
is less than zero or greater than Length.
Applies to
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應