table.concat

Concatenates table items together into a string

Prototype

s = table.concat (t, sep, start, end)

Description

Returns the (numeric) entries in the table t, concatenated together with "sep" as the separator, starting at index 'start' and ending at index 'end'. The entries are returned as a single string variable. Contrast this to the "unpack" function which returns a table as individual variables.

Start defaults to 1 and end the table size.
Sep defaults to an empty string.

t = { "the", "quick", "brown", "fox" }
print (table.concat (t, ';')) --> the;quick;brown;fox

Lua functions

Topics