當前位置:成語大全網 - 書法字典 - 如何使用lua table.remove?

如何使用lua table.remove?

用法:table . remove(t,index)

第壹個參數是表格,第二個參數是要刪除的表格元素的索引。

例如:

Lua的Hello World

t={}

t【1】= 4

t【2】= 8

t【3】= 5

表。移除(t,2)

打印(t【2】)

打印(t【3】)