How do I display array elements in Lua?

前端 未结 3 948
Happy的楠姐
Happy的楠姐 2021-01-14 03:35

I\'m having an issue displaying the elements of an array in Lua programming language. Basically, i created an array with 3 elements, and i\'m trying to display its contents

3条回答
  •  醉酒成梦
    2021-01-14 03:52

    Why not just print the table in "table.concat" function?

    myText = {"hello", "world", "there"}
    print(table.concat(myText,", "))
    

    hello, world, there

提交回复
热议问题