StringSegment.Substring 方法

定义

重载

Substring(Int32)

从此 StringSegment 检索子字符串。 子字符串从 offset 指定的位置开始,并具有剩余长度。

Substring(Int32, Int32)

从此 StringSegment 检索子字符串。 子字符串从 offset 指定的位置开始,并具有指定的 length

Substring(Int32)

Source:
StringSegment.cs
Source:
StringSegment.cs
Source:
StringSegment.cs

从此 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)

Source:
StringSegment.cs
Source:
StringSegment.cs
Source:
StringSegment.cs

从此 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子字符串。

例外

offsetlength 小于零,或 offset + length 大于 Length

适用于