Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tab = {
- ['A'] = {Number = 1}
- }
- --Standard way to remove a value from a table
- for i,v in next, tab do
- if i == 'A' then
- table.remove(tab,i) --Except here, i is a string, not a number
- end
- end
- -- If I try to do
- tab['A'] = nil
- --this wont work because of the fact that
- ' for i,v in next, ' doesnt like nil values in tables.
- What is the workaround for removing a key that is a string from a table?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement