Top "Lua-table" questions

This tag refers to the table type in Lua that implements associative arrays.

Why do Lua arrays(tables) start at 1 instead of 0?

I don't understand the rationale behind the decision of this part of Lua. Why does indexing start at 1? I have …

arrays lua lua-table
lua: retrieve list of keys in a table

I need to know how to retrieve the key set of a table in lua. for example, if I have …

lua lua-table keyset
how to delete all elements in a Lua table?

How do I delete all elements inside a Lua table? I don't want to do: t = {} table.insert(t, 1) t = {} …

lua lua-table
Associatively sorting a table by value in Lua

I have a key => value table I'd like to sort in Lua. The keys are all integers, but aren't …

sorting lua lua-table asort
Sort a Table[] in Lua

I have a Lua table that I am trying to sort. The table's format is as follows: tableOfKills[PlayerName] = NumberOfKills …

sorting lua lua-table
Lua table.toString(tableName) and table.fromString(stringTable) functions?

I am wanting to convert a 2d lua table into a string, then after converting it to a string convert …

serialization lua lua-table
Lua - convert string to table

I want to convert string text to table and this text must be divided on characters. Every character must be …

string lua lua-table
What's the difference between table.insert(t, i) and t[#t+1] = i?

In Lua, there seem to be two ways of appending an element to an array: table.insert(t, i) and …

lua lua-table
Lua: How to find out if an element is a table instead of a string/number?

As the title says, what function or check can I do to find out if a lua element is a …

lua lua-table
How to 'unpack' table into function arguments

I'm trying to call a function in Lua that accepts multiple 'number' arguments function addShape(x1, y1, x2, y2 ... xn, …

lua lua-table