Table of Contents

Struct TextRange

Namespace
Avalonia.Media.TextFormatting
Assembly
Avalonia.Base.dll

References a portion of a text buffer.

public readonly struct TextRange : IEquatable<TextRange>
Implements
Inherited Members

Constructors

TextRange(int, int)

public TextRange(int start, int length)

Parameters

start int
length int

Properties

End

Gets the end.

public int End { get; }

Property Value

int

The end.

Length

Gets the length.

public int Length { get; }

Property Value

int

The length.

Start

Gets the start.

public int Start { get; }

Property Value

int

The start.

Methods

Equals(TextRange)

public bool Equals(TextRange other)

Parameters

other TextRange

Returns

bool

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Skip(int)

Bypasses a specified number of elements in the slice and then returns the remaining elements.

public TextRange Skip(int length)

Parameters

length int

The number of elements to skip before returning the remaining elements.

Returns

TextRange

A TextRange that contains the elements that occur after the specified index in this slice.

Take(int)

Returns a specified number of contiguous elements from the start of the slice.

public TextRange Take(int length)

Parameters

length int

The number of elements to return.

Returns

TextRange

A TextRange that contains the specified number of elements from the start of this slice.

ToString()

public override string ToString()

Returns

string

Operators

operator ==(TextRange, TextRange)

public static bool operator ==(TextRange left, TextRange right)

Parameters

left TextRange
right TextRange

Returns

bool

operator !=(TextRange, TextRange)

public static bool operator !=(TextRange left, TextRange right)

Parameters

left TextRange
right TextRange

Returns

bool