TextSpan Struct

Represents a span of text in the source query string.

public readonly struct TextSpan

Constructors

NameDescription
TextSpan(int, int)Initializes a new instance of the TextSpan struct.

TextSpan(int, int)

TextSpan.cs

Initializes a new instance of the TextSpan struct.

public TextSpan(int start, int length)

Parameters

start int
The starting position of the span.
length int
The length of the span.

Properties

NameDescription
EndGets the ending position of the span (exclusive).
LengthGets the length of the span.
StartGets the starting position of the span.

Gets the ending position of the span (exclusive).

public int End { get; }

Property value

int

Gets the length of the span.

public int Length { get; }

Property value

int

Gets the starting position of the span.

public int Start { get; }

Property value

int

Methods

NameDescription
FromBounds(int, int)Creates a text span from start and end positions.
ToString()

FromBounds(int, int)

TextSpan.cs

Creates a text span from start and end positions.

public static TextSpan FromBounds(int start, int end)

Parameters

start int
The starting position of the span.
end int
The ending position of the span (exclusive).

Returns

TextSpan A text span covering the specified range.

ToString()

TextSpan.cs
public override string ToString()

Returns

string

No documentation is available.