kaven-basic - v6.0.0
    Preparing search index...

    Class StringPosition

    Represents a position or range within a string, defined by a start index and an optional end index.

    Provides utility methods and properties to work with string positions, such as calculating length, comparing positions, and associating the position with a specific string.

    • The Start property defines the starting index of the position.
    • The End property (optional) defines the exclusive end index of the position.
    • The Length property computes the length of the range as End - Start.
    • The RelatedString property can be used to associate this position with a specific string.
    const pos = new StringPosition(5, 10);
    console.log(pos.Length); // 5

    4.0.0

    2022-06-26

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    • Parameters

      • start: number

      Returns StringPosition

    • Parameters

      • start: number
      • end: number

      Returns StringPosition

    Properties

    End: undefined | number
    RelatedString: undefined | string
    Start: number

    Accessors

    • get Length(): number

      Returns number

    • set Length(len: number): void

      Parameters

      • len: number

      Returns void

    Methods

    • Parameters

      Returns boolean

    • Returns string

    • Parameters

      • start: number
      • length: number

      Returns StringPosition