ReadOnlySpan<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 read-only span that begins at a specified index. |
Slice(Int32, Int32) |
Forms a slice out of the current read-only span starting at a specified index for a specified length. |
Slice(Int32)
- Source:
- ReadOnlySpan.cs
- Source:
- ReadOnlySpan.cs
- Source:
- ReadOnlySpan.cs
Forms a slice out of the current read-only span that begins at a specified index.
public:
ReadOnlySpan<T> Slice(int start);
public ReadOnlySpan<T> Slice (int start);
member this.Slice : int -> ReadOnlySpan<'T>
Public Function Slice (start As Integer) As ReadOnlySpan(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 greater than the number of items in the read-only span.
Applies to
Slice(Int32, Int32)
- Source:
- ReadOnlySpan.cs
- Source:
- ReadOnlySpan.cs
- Source:
- ReadOnlySpan.cs
Forms a slice out of the current read-only span starting at a specified index for a specified length.
public:
ReadOnlySpan<T> Slice(int start, int length);
public ReadOnlySpan<T> Slice (int start, int length);
member this.Slice : int * int -> ReadOnlySpan<'T>
Public Function Slice (start As Integer, length As Integer) As ReadOnlySpan(Of T)
Parameters
- start
- Int32
The index at which to begin this slice.
- length
- Int32
The desired length for the slice.
Returns
A read-only span that consists of length
elements from the current span starting at start
.
Exceptions
start
is less than zero or greater than Length.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기