@nevware21/ts-utils
    Preparing search index...

    Function strAt

    • The strAt() method takes an integer value and returns a new string consisting of the single UTF-16 code unit located at the specified offset into the string. It accepts both positive and negative integers: negative integers count back from the last string character.

      This is the equivalent of String.prototype.at() and falls back to polyStrAt in environments where the native method is unavailable.

      Parameters

      • value: string

        The string value to retrieve a character from.

      • index: number

        The zero-based index of the character to return. A negative index counts from the end of the string: -1 returns the last character, -2 the second-to-last, and so on.

      Returns string

      A single-character string at the given index, or undefined if the index is out of range.

      0.14.0

      TypeError if value is null or undefined.

      strAt("hello", 0);   // "h"
      strAt("hello", 1); // "e"
      strAt("hello", -1); // "o" — last character
      strAt("hello", -2); // "l" — second-to-last
      strAt("hello", 99); // undefined — out of range
      strAt("hello", -99); // undefined — out of range