platform-bible-utils
    Preparing search index...

    Function substring

    • This function mirrors the substring function from the JavaScript Standard String object. It operates on grapheme clusters instead of UTF-16 code units.

      Returns the part of the string between a start and an end index.

      Parameters

      • string: string

        String to be divided

      • begin: number

        Start position. Negative values clamp to 0 rather than counting from the end

      • Optionalend: number

        End position. Default is the end of the string. As in native, the two arguments are swapped when begin is greater than end

      Returns string

      Substring from the starting string