Jump to content




[Solved]Table to string and string to table


  • You cannot reply to this topic
2 replies to this topic

#1 beneruvos

  • New Members
  • 1 posts

Posted 28 September 2014 - 11:02 AM

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 by beneruvos, 28 September 2014 - 12:49 PM.


#2 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 28 September 2014 - 11:06 AM

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.

#3 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 28 September 2014 - 11:37 AM

In regards to going from a string to a table, you'd want string.sub(), which is documented over here.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users