Continuous non-empty span of text, relative to some large text.

Constructors

Properties

Accessors

Methods

Constructors

  • Parameters

    • start: number

      The first character of this span as a zero-based offset within the full text.

    • end: number

      Zero-based index of the character immediately following this span. The span cannot be empty.

    Returns CharSpan

Properties

end: number

Zero-based index of the character immediately following this span. The span cannot be empty.

start: number

The first character of this span as a zero-based offset within the full text.

Accessors

Methods

  • Substring of a full text as denoted by this span.

    Parameters

    • fullText: string

    Returns string

  • Creates a CharSpan object from [start] index and [end] index.

    Parameters

    • start: number

      The first character of this span as a zero-based offset within the full text.

    • end: number

      Index of the character immediately following this span.

    Returns CharSpan

  • Creates a CharSpan object from [start] index and text [length].

    Parameters

    • start: number

      The first character of this span as a zero-based offset within the full text.

    • length: number

      The length of this span.

    Returns CharSpan