Posted 11 March 2013 - 11:15 PM
As the title says, I am trying to take random letters and numbers from a table which is randomly generated, and make them all into a single variable.
I have been going through the http://lua-users.org/wiki/ for about an hour now looking for such a function, and this is my question, does this exist? or do we have to come up with some really smart way of combining them?
*EDIT*
Found it. Just by chance, table.concat(table, separator)
so if you did something like
It would create it exactly how it is in the table, but if you were to change the separator to like "l" then there would be a l between each table item in the variable, so like 1l2l3l4l5l6l7
I have been going through the http://lua-users.org/wiki/ for about an hour now looking for such a function, and this is my question, does this exist? or do we have to come up with some really smart way of combining them?
*EDIT*
Found it. Just by chance, table.concat(table, separator)
so if you did something like
tableToJoin = {1,2,3,4,5,6,7}
joined = table.concat(tableToJoin, ",")
It would create it exactly how it is in the table, but if you were to change the separator to like "l" then there would be a l between each table item in the variable, so like 1l2l3l4l5l6l7