• Looks for the first match of pattern in the string s. If it finds a match, then find returns the indices of s where this occurrence starts and ends, as well as any matches after that. Otherwise, it returns nil. A third, optional numerical argument init specifies where to start the search; its default value is 1 and can be negative. A value of true as a fourth, optional argument plain turns off the pattern matching facilities, so the function does a plain "find substring" operation, with no characters in the pattern being considered "magic". Note that if plain is given, then init must be given as well.

    Parameters

    • str: string
    • pattern: string
    • Optional init: number
    • Optional plain: boolean

    Returns LuaTuple<[number, number, ...(string | number)[]] | undefined[]>