2

I have a table = {1, 2, 3}

Now i want to print everything in the table but seperated with "/" meaning my result should be 1/2/3 The problem is that my table constantly updates and sometimes it changes to {1, 3} or even just {2} so how can i print everything in the table but each value seperated by a "/" without ending like one of the following:

1//3

13

1/3/

but instead:

1/3

Pxsted
  • 21
  • 4
  • 5
    `a={1, 2, 3} print(table.concat(a,"/"))`. – lhf Jun 25 '22 at 17:10
  • Normally Lua doesn't have parallelism. What platform is your Lua embedded in? Use that to "lock" your table to ensure it doesn't change while you're printing it, as [inserting new value is "undefined behavior"](https://stackoverflow.com/questions/6167555/how-can-i-safely-iterate-a-lua-table-while-keys-are-being-removed). – user202729 Jun 26 '22 at 16:49

0 Answers0