在卢阿表内表 [英] table inside table in Lua
本文介绍了在卢阿表内表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我该如何获取表内表的数据,我的意思是这样:
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] )
结果将是->>> {a,b,c}
the result will be —–>>> {a, b, c}
但是
我如何只打印字母"a"?不使用ipairs
的意思是有没有办法使用t[1]
之类的东西?
how can I print just the letter "a"? without using ipairs
I mean is there any way to use something like t[1]
?
推荐答案
您是否尝试过t[1][1]
?那应该使您从t[1]
Have you tried t[1][1]
? That should get you the first index in the table you get from t[1]
这篇关于在卢阿表内表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文