table inside table in Lua

試著忘記壹切 提交于 2019-11-28 07:23:07

问题


How can I get the data which is a table inside a table, i mean like this:

t = { {a, b, c}, {d, e, f} };

if I write this line of code:

print( t[1] )

the result will be —–>>> {a, b, c}

BUT

how can I print just the letter “a”? without using ipairs I mean is there any way to use something like t[1]?


回答1:


Have you tried t[1][1]? That should get you the first index in the table you get from t[1]



来源:https://stackoverflow.com/questions/6807969/table-inside-table-in-lua

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!