Recently I had a need to concatenate a few tables in Lua and thought that it might be useful to share for those who may need to do something similar. A very simple three line function that can be expanded to accommodate even more tables as need be.
1 2 3 4 5 6 |
function mergetables(t1, t2) for i=1,#t2 do t1[#t1+1] = t2[i] end return t1 end |