table.concat

From Garry's Mod
Jump to: navigation, search
 table.concat( )

Contents

Description

Concatenates the contents of a table to a string.

Arguments

table tbl

The table to concatenate.

Arguments

string concatenator=""

A seperator to insert between strings

Arguments

number startPos=1

The key to start at

Arguments

number endPos=#tbl

The key to end at

Returns

string

Concatenated values

Examples

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
Personal tools
Navigation