I need to convert a table into a comma separated list in order to save it to a text file. Is there a built in method for doing this in Lua?
If your table is an array, you can use table.concat
to print CSVs:
t={10,20,30}
print(table.concat(t,","))
outputs 10,20,30
.
There isn't a built in function, but there are examples onthe web.
This is a decent one actually.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With