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