Add table.concat
This commit is contained in:
parent
39dca1c3b2
commit
f8c4b94165
1 changed files with 15 additions and 0 deletions
|
@ -69,3 +69,18 @@ function table.filter(target, predicate)
|
|||
end
|
||||
return result
|
||||
end
|
||||
|
||||
--- Concatenates two tables into a new table.
|
||||
--- @param table1 table The first table
|
||||
--- @param table2 table The second table
|
||||
--- @return table The concatenated table
|
||||
function table.concat(table1, table2)
|
||||
local result = {}
|
||||
for _, v in pairs(table1) do
|
||||
table.insert(result, v)
|
||||
end
|
||||
for _, v in pairs(table2) do
|
||||
table.insert(result, v)
|
||||
end
|
||||
return result
|
||||
end
|
Loading…
Add table
Reference in a new issue