Remove an entry from a table by key if the key is a string
3 replies, posted
I can't seem to figure out how to remove an entry from a table if the entry has a string key. I have tried table.remove, but obviously that wont work as it requires a number key. I have tried table.RemoveByValue, but that doesn't work as that uses table.remove to work.
If you know the key, just set the entry to nil
TABLENAME[ "KEYNAME" ] = nil
Oh lol, thanks, didnt think that would work so I never tried it. Worked perfectly thank you
If it's a string you can also index it using a dot at the start like so:
TABLENAME.KEYNAME = nil
Sorry, you need to Log In to post a reply to this thread.