Version: stable
FUNCTION | |
---|---|
table.concat() | concatenates table items together into a string |
table.insert() | inserts a new item into a numerically-keyed table |
table.maxn() | returns the highest numeric key in the table |
table.remove() | removes an item from a numerically-keyed table |
table.sort() | Sorts a table |
table.concat(table,[sep],[i],[j])
table[i]..sep..table[i+1] ... sep..table[j]
.
The default value for sep is the empty string,
the default for i is 1,
and the default for j is the length of the table.
If i is greater than j, returns the empty string.
PARAMETERS
table |
|
[sep] |
|
[i] |
|
[j] |
table.insert(table,[pos],value)
n+1
,
where n is the length of the table ,
so that a call table.insert(t,x)
inserts x at the end
of table t.
PARAMETERS
table |
|
[pos] |
|
value |
table.maxn(table)
PARAMETERS
table |
table.remove(table,[pos])
table.remove(t)
removes the last element
of table t.
PARAMETERS
table |
|
[pos] |
table.sort(table,[comp])
table[1]
to table[n]
,
where n is the length of the table.
If comp is given,
then it must be a function that receives two table elements,
and returns true
when the first is less than the second
(so that not comp(a[i+1],a[i])
will be true after the sort).
If comp is not given,
then the standard Lua operator <
is used instead.
The sort algorithm is not stable;
that is, elements considered equal by the given order
may have their relative positions changed by the sort.
PARAMETERS
table |
|
[comp] |