mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-22 23:42:59 +00:00
fixed table.tostring
This commit is contained in:
parent
d479e167b9
commit
484b7532eb
1 changed files with 5 additions and 5 deletions
|
@ -9,12 +9,12 @@ local function table_tostring(tbl, sep, new_line)
|
||||||
local ret = {}
|
local ret = {}
|
||||||
if type(tbl) ~= "table" then return "Error: input not table!" end
|
if type(tbl) ~= "table" then return "Error: input not table!" end
|
||||||
for key,value in pairs(tbl) do
|
for key,value in pairs(tbl) do
|
||||||
ret:append(key)
|
table.insert(ret,key)
|
||||||
ret:append(sep)
|
table.insert(ret,sep)
|
||||||
ret:append(value)
|
table.insert(ret,value)
|
||||||
ret:append(new_line)
|
table.insert(ret,new_line)
|
||||||
end
|
end
|
||||||
return ret:concat("")
|
return table.concat(ret,"")
|
||||||
end
|
end
|
||||||
|
|
||||||
return table_tostring
|
return table_tostring
|
||||||
|
|
Loading…
Reference in a new issue