table
This library provides generic functions for table/array manipulation, providing all its functions inside the global table variable. Most functions in the table library assume that the table represents an array or a list. For these functions, the "length" of a table means the result of the length operator.
Summary
Functions
Sets all keys in the given table to nil.
Returns a shallow copy of the provided table.
Returns the given range of table elements as a string where each element is separated by the given separator.
Returns a new table populated with many instances of the specified value.
Returns the index of the first occurrence of needle within haystack starting from init.
Makes the given table read-only.
Inserts the provided value to the target position of the array.
Appends the provided value to the end of the array.
Returns true if the given table is frozen and false if it isn't frozen.
Returns the maximum numeric key of the provided table, or zero if the table has no numeric keys.
Copies the specified range of elements from one table to another.
Returns a new table containing the provided values.
Removes the specified element from the array, shifting later elements down to fill in the empty space if possible.
Sorts table elements using the provided comparison function or the < operator.
Returns all elements from the given list as a tuple.