7

In Lua, I know there is

table.remove(array, index)

Is there a fast way to remove and return X elements from the array (without just repeated calls to table.remove)?

1 Answer 1

4

No; there is no API to remove and return several elements from a table. You can use table.remove, array[index] = nil, or resetting array to an empty table and repopulating (if you have majority elements to remove).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.