Garry's Mod Wiki

table.concat

  string table.concat( table tbl, string concatenator = "", number startPos = 1, number endPos = #tbl )

Description

Concatenates the contents of a table to a string.

Arguments

1 table tbl
The table to concatenate.
2 string concatenator = "\"
A separator to insert between strings
3 number startPos = 1
The key to start at
4 number endPos = #tbl
The key to end at

Returns

1 string
Concatenated values

Example

Demonstrates the use of this function.

local Table = { "A", "simple", "table.concat", "test" } print( table.concat( Table ) ) print( table.concat( Table, " " ) ) print( table.concat( Table, " ", 3, 4 ) )
Output:
Asimpletable.concattest A simple table.concat test table.concat test