This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
beneruvos's profile picture

[Solved]Table to string and string to table

Started by beneruvos, 28 September 2014 - 10:02 AM
beneruvos #1
Posted 28 September 2014 - 12:02 PM
I need to convert the table to string and string to table for example
a = {1,2,3,4)
aa = "1234"
i need convert the a to aa and aa to a
Pls help me and sorry for my bad eng.!

Thank you to everyone who responded, I've recently started with computercraft and i dont know lua :)/>
Edited on 28 September 2014 - 11:49 AM
theoriginalbit #2
Posted 28 September 2014 - 12:06 PM
what you're looking for is table.concat, take a look at it, and other useful functions for tables, in the tables tutorial over at Lua-users.org.
Bomb Bloke #3
Posted 28 September 2014 - 12:37 PM
In regards to going from a string to a table, you'd want string.sub(), which is documented over here.