419 posts
Location
your hardrive
Posted 04 March 2013 - 11:32 AM
how do you get a table like:
letters = {"a", "b", "c"}
to
"abc"
758 posts
Location
Budapest, Hungary
Posted 04 March 2013 - 11:35 AM
local output = ""
local mytable = {"a", "b", "c"}
for i = 1, #mytable do output = output .. mytable[i] end
print(output)
You want me to explain?
1688 posts
Location
'MURICA
Posted 04 March 2013 - 11:36 AM
Nicer way:
str = table.concat(letters)
print(str)
Only works with tables with numeric indices though.
758 posts
Location
Budapest, Hungary
Posted 04 March 2013 - 11:37 AM
Now that's why YOU are the "Lua God" and I am the "Scripter" :D/>
2217 posts
Location
3232235883
Posted 04 March 2013 - 11:40 AM
usage is table.concat("string","spacer")
spacer can be anything separating the table elements (including nil or "")
758 posts
Location
Budapest, Hungary
Posted 04 March 2013 - 11:44 AM
-snip-
I know what table.concat is, I just have no experience with it yet. That's why I haven't mentioned it…
(I know that that post was mainly an answer for ETHANATOR - or at least I hope so…)