StringSegment.AsSpan 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
AsSpan() |
從目前的 StringSegment 取得 ReadOnlySpan<T>。 |
AsSpan(Int32) |
從目前的 StringSegment 取得 , ReadOnlySpan<T> 從 所 |
AsSpan(Int32, Int32) |
ReadOnlySpan<T>從目前的 StringSegment 取得 ,從 所 |
AsSpan()
從目前的 StringSegment 取得 ReadOnlySpan<T>。
public:
ReadOnlySpan<char> AsSpan();
public ReadOnlySpan<char> AsSpan ();
member this.AsSpan : unit -> ReadOnlySpan<char>
Public Function AsSpan () As ReadOnlySpan(Of Char)
傳回
來自此 StringSegment 的 ReadOnlySpan<T>。
適用於
AsSpan(Int32)
從目前的 StringSegment 取得 , ReadOnlySpan<T> 從 所 start
指定的位置開始,而且具有剩餘的長度。
public:
ReadOnlySpan<char> AsSpan(int start);
public ReadOnlySpan<char> AsSpan (int start);
member this.AsSpan : int -> ReadOnlySpan<char>
Public Function AsSpan (start As Integer) As ReadOnlySpan(Of Char)
參數
- start
- Int32
這個 StringSegment 中以零起始的起始字元位置。
傳回
, ReadOnlySpan<T> 其中剩餘的字元從這個 StringSegment 開始 start
。
例外狀況
start
大於或等於 Length 或小於零。
適用於
AsSpan(Int32, Int32)
ReadOnlySpan<T>從目前的 StringSegment 取得 ,從 所 start
指定的位置開始,而且具有指定的 length
。
public:
ReadOnlySpan<char> AsSpan(int start, int length);
public ReadOnlySpan<char> AsSpan (int start, int length);
member this.AsSpan : int * int -> ReadOnlySpan<char>
Public Function AsSpan (start As Integer, length As Integer) As ReadOnlySpan(Of Char)
參數
- start
- Int32
這個 StringSegment 中以零起始的起始字元位置。
- length
- Int32
範圍中的字元數。
傳回
ReadOnlySpan<T>,其長度 length
從 start
這個 StringSegment 開始。
例外狀況
start
或 length
小於零,或 start
+ length
大於 Length。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應