Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you remove strings from tables with its name?

Asked by
ItsMeKlc 235 Moderation Voter
8 years ago

Normal to use table.remove you would have to use use the number placement of that item, is there a way to do it with its name? Like this:

names = {"Hi","Bye"}
table.remove(names, "Bye") --This doesn't work of course 

1 answer

Log in to vote
0
Answered by 8 years ago

table.remove is a function with two specific arguments: the table, and it's numeric index (implying it must be an array).

I've given a very detailed explanation on this, where you can find here: https://scriptinghelpers.org/questions/22565/tableinsert-and-tableremove#26210

0
Ok I got it, I can just set the order of the table then remove it. Thanks! ItsMeKlc 235 — 8y
Ad

Answer this question