Skip to content

FindInTable

Return the index of the first row in the table that matches the given criteria.

Argument Data Type Needed Default Description
Table table - The table to search.
Text string - The text to search for.

Dont need to be called every frame


Example
local table = {
    "Jhon",
    "Doe",
    "Smith",
    "Robinson",
    "Smith",
    "George"
}

local i = FindInTable(table, "Smith")

print(i)
Expected result
3

Last update: October 31, 2022
Created: April 12, 2022