Standard Library Tables
Concat Separator
Join array-style values with table.concat.
Concat Separator
concat_separator.lua
local separator =
local joined = table.concat({"red", "green", "blue"}, separator)
print("separator=" .. separator)
print("joined=" .. joined)
local separator =
local joined = table.concat({"red", "green", "blue"}, separator)
print("separator=" .. separator)
print("joined=" .. joined)
local separator =
local joined = table.concat({"red", "green", "blue"}, separator)
print("separator=" .. separator)
print("joined=" .. joined)
joined text
`table.concat` returns one string, so the replay can show the scalar result without exposing a table object.