StringSegment.Substring 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| 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 A 等價於此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一個等價於該子串,該offset子串length始於此StringSegment。
例外狀況
offset或length小於零,或lengthoffset + 大於。Length