DevToys logo DevToys
  • Home
  • Blog
  • Documentation
  • Download
Search Results for

    Show / Hide Table of Contents

    Class TextSpan

    Represents a span in a text.

    Inheritance
    object
    TextSpan
    UIHighlightedTextSpan
    UIHoverTooltip
    Implements
    IEquatable<TextSpan>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: DevToys.Api
    Assembly: DevToys.Api.dll
    Syntax
    public record TextSpan : IEquatable<TextSpan>

    Constructors

    TextSpan(int, int)

    Initializes a new instance of the TextSpan class.

    Declaration
    public TextSpan(int startPosition, int length)
    Parameters
    Type Name Description
    int startPosition

    The position at which the span starts.

    int length

    The length of the span.

    Properties

    EndPosition

    Gets the end position of the span.

    Declaration
    public int EndPosition { get; }
    Property Value
    Type Description
    int

    Length

    Gets the length of the span.

    Declaration
    public int Length { get; }
    Property Value
    Type Description
    int

    StartPosition

    Gets the position at which the span starts.

    Declaration
    public int StartPosition { get; }
    Property Value
    Type Description
    int

    Methods

    FromBounds(int, int)

    Creates a new TextSpan from the given start and end positions.

    Declaration
    public static TextSpan FromBounds(int start, int end)
    Parameters
    Type Name Description
    int start

    The position at which the span starts.

    int end

    The position at which the span ends.

    Returns
    Type Description
    TextSpan

    Implements

    IEquatable<T>

    Extension Methods

    LoggingExtensions.Log<T>(T)
    In this article
    DevToys logo © 2024 DevToys