StringSegment 构造函数

定义

重载

StringSegment(String)

初始化 StringSegment 结构的实例。Initializes an instance of the StringSegment struct.

StringSegment(String, Int32, Int32)

初始化 StringSegment 结构的实例。Initializes an instance of the StringSegment struct.

StringSegment(String)

初始化 StringSegment 结构的实例。Initializes an instance of the StringSegment struct.

public:
 StringSegment(System::String ^ buffer);
public StringSegment (string buffer);
new Microsoft.Extensions.Primitives.StringSegment : string -> Microsoft.Extensions.Primitives.StringSegment
Public Sub New (buffer As String)

参数

buffer
String

原始 StringThe original String. StringSegment 包括整个 StringThe StringSegment includes the whole String.

适用于

StringSegment(String, Int32, Int32)

初始化 StringSegment 结构的实例。Initializes an instance of the StringSegment struct.

public:
 StringSegment(System::String ^ buffer, int offset, int length);
public StringSegment (string buffer, int offset, int length);
new Microsoft.Extensions.Primitives.StringSegment : string * int * int -> Microsoft.Extensions.Primitives.StringSegment
Public Sub New (buffer As String, offset As Integer, length As Integer)

参数

buffer
String

用作缓冲区的原始 StringThe original String used as buffer.

offset
Int32

buffer 中段的偏移量。The offset of the segment within the buffer.

length
Int32

段的长度。The length of the segment.

例外

buffernullbuffer is null.

offsetlength 小于零,或者 offset + length 大于 buffer 中的字符数。offset or length is less than zero, or offset + length is greater than the number of characters in buffer.

适用于