StringSegment Constructors

Definition

Overloads

StringSegment(String)

Initializes an instance of the StringSegment struct.

StringSegment(String, Int32, Int32)

Initializes an instance of the StringSegment struct.

StringSegment(String)

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

Initializes an instance of the StringSegment struct.

C#
public StringSegment(string? buffer);

Parameters

buffer
String

The original String. The StringSegment includes the whole String.

Applies to

.NET 10 (package-provided) и другие версии
Продукт Версии
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)

StringSegment(String, Int32, Int32)

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

Initializes an instance of the StringSegment struct.

C#
public StringSegment(string buffer, int offset, int length);

Parameters

buffer
String

The original String used as buffer.

offset
Int32

The offset of the segment within the buffer.

length
Int32

The length of the segment.

Exceptions

buffer is null.

offset or length is less than zero, or offset + length is greater than the number of characters in buffer.

Applies to

.NET 10 (package-provided) и другие версии
Продукт Версии
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)