mytable={"a","b","c","d"}
–拼接 concat
table.concat(mytable)--无缝拼接
table.concat(mytable,"-")--指定字符分割拼接
table.concat(mytable,"-",1,3)--指定字符,指定索引拼接
–插入
--#mytable获得表的长度
print(#mytable)
--用赋值的方式在末尾添加
mytable[#mytable+1]="e"
--用table的函数添加
table.insert(mytable,"f")--在末尾添加
table.insert(mytable,2,"newvalue")--在指定位置插入值,后面的值索引自动加1
–删除
table.remove(mytable)--删除最后一位值
table.remove(mytable,2)--删除指定位置的值