Lua spread operator on an array
snippet in lua

Lua spread operator on an array

user6311

-- Your comment to my question just made me realize you can totally do it with unpack.
t = {"One", "Two", "Three"};
string.format("%s %s %s", table.unpack(t)); -- One Two Three

-- With your implementation,
-- I believe you might need to increase the length of your args though.
local f = "Your table contains ";
for i = 1, #t do
    f.." %s";
end
string.format(f, table.unpack(t));