lua table

Posted guomengkai

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了lua table相关的知识,希望对你有一定的参考价值。

table.concat (table [, sep [, start [, end]]]):

  concat是concatenate(连锁, 连接)的缩写. table.concat()函数列出参数中指定table的数组部分从start位置到end位置的所有元素, 元素间以指定的分隔符(sep)隔开。

 

fruits = {"banana","orange","apple"}

  print("连接后的字符串 ",table.concat(fruits,", ", 2,3))

 

table.sort (table [, comp])

  对给定的table进行升序排序

 

  fruits = {"banana","orange","apple","grapes"}

  table.sort(fruits)

以上是关于lua table的主要内容,如果未能解决你的问题,请参考以下文章