Standard Library Tables
Concat Window
Limit table.concat to part of an array.
Concat Window
concat_window.lua
local firstIndex =
local lastIndex = firstIndex + 1
local joined = table.concat({"red", "green", "blue", "gray"}, "-", firstIndex, lastIndex)
print("firstIndex=" .. firstIndex)
print("lastIndex=" .. lastIndex)
print("joined=" .. joined)
local firstIndex =
local lastIndex = firstIndex + 1
local joined = table.concat({"red", "green", "blue", "gray"}, "-", firstIndex, lastIndex)
print("firstIndex=" .. firstIndex)
print("lastIndex=" .. lastIndex)
print("joined=" .. joined)
local firstIndex =
local lastIndex = firstIndex + 1
local joined = table.concat({"red", "green", "blue", "gray"}, "-", firstIndex, lastIndex)
print("firstIndex=" .. firstIndex)
print("lastIndex=" .. lastIndex)
print("joined=" .. joined)
start and finish
The optional start and finish indexes choose which items are joined.