I was wondering if anyone can tell me how to print anything in a table(temptable
) in the same line, without creating a new one for each item in it.
Script I've tried:
local temptable = {"Test","Test2"} for _,v in pairs(temptable) do print(v) end
But that does:
Test Test2
Instead, I want it to do:
Test Test2
Any suggestions on how I could accomplish this? Any help appreciated.
A nice, built-in Lua function for working with tables: unpack (or table.unpack in Lua 5.3)
table = {'as', 'df'}; print(unpack(table));