Lua Tables

A lot of programming languages offer various data structures, such as arrays, lists, queues, and sets, to name a few. Lua is different, however, as it has one data structure called tables, that is used to represent these other structures.

Regardless of the structure being represented, tables provide a number of methods allowing for the easy manipulation of them. Example usage of these are available in the following pages.

  • concat - Concatenate or join the values in the structure being represented. A separator, such as a comma, can be specified to go between each value.
  • insert - Insert a value into the structure being represented at the specified position.
  • remove - Remove a specified value from the structure being represented.
  • sort - Sort values in the structure being represented based on the specified argument.