• Pure

    Returns a new substring from the interval [start, end) - inclusive, exclusive. Positions are zero-indexed. For empty or invalid out-of-bounds values returns an empty string "" (in Lua).

    For start>end returns substring beginning with start until the actual end of string. For start<0 returns an empty string.

    Examples (Lua):

    SubString("abc", 0, 0) == ""
    SubString("abc", 0, 1) == "a"
    SubString("abc", 2, 3) == "c"
    SubString("abc", 0, 3) == "abc"
    SubString("abcdef", 2, 0) == "cdef"

    Parameters

    • source: string

      Text string.

    • start: number

      Starting position, zero-indexed, inclusive.

    • end: number

      Last position, zero-indexed, exclusive.

    Returns string

Generated using TypeDoc