Table of Contents

Struct TextSpan

Namespace
Icy.Design.Text
Assembly
IcyUI.Design.dll

Represents a contiguous range of characters in a markup text.

public readonly record struct TextSpan : IEquatable<TextSpan>
Implements
Inherited Members
Extension Methods

Constructors

TextSpan(int, int)

Initializes a new instance of the TextSpan struct.

public TextSpan(int start, int length)

Parameters

start int

The offset of the first character in the span.

length int

The number of characters in the span.

Exceptions

ArgumentOutOfRangeException

start or length is negative.

Properties

End

Gets the offset just past the last character in the span.

public int End { get; }

Property Value

int

Length

Gets the number of characters in the span.

public int Length { get; }

Property Value

int

Start

Gets the offset of the first character in the span.

public int Start { get; }

Property Value

int

Methods

FromBounds(int, int)

Creates a span from its start and end offsets.

public static TextSpan FromBounds(int start, int end)

Parameters

start int

The offset of the first character in the span.

end int

The offset just past the last character in the span.

Returns

TextSpan

The span covering [start, end).

Exceptions

ArgumentOutOfRangeException

end is less than start.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.