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 seperator 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

Page Links


Special Pages


Wikis

?

Render Time: 34ms

DB GetPage 4
Generate Html 11
SaveChanges (1) 9
Render Body 0
Render Sidebar 7