Removing a string from a table

How can I remove a specific value from a table?
I want to achieve something like this:

local tools = {"Apple", "Banana","Cane"}
table.remove(tools, "Apple")

1 Like

Instead of value, you have to use the index itself when removing values from arrays.

local tools = {"Apple", "Banana","Cane"}

local index = table.find(tools, "Apple") --get the index
table.remove(tools, index) --remove the index
27 Likes