转自:http://blog.chinahr.com/blog/pxss/post/19550
table.concat(table [,sep[,i[,j]]]):
从第i个位置开始,到j为止,每隔一个元素插入一个sep.返回他们生成的字符串.默认i=1,j=长度.如果省略了后面三个参数,则返回一个table元素组成的字符串.table中的元素只能是字符串或数值.不能是function,table等.
table.insert(table [,pos],value)
将value插入到table中的第pos个位置上,默认pos=长度+1.value为基本类型(string/number)
table.remove(table [,pos])移除第pos个函数,结果返回移除掉的元素.默认是最后个
table.foreach(table,f)
table.foreachi (table, f)
table.getn(table):返回元素个数.
table.setn(table,n):设置长度.
table.sort(table [,cmp])
按cmp给的方式排序,cmp是一个比较函数.比如,
cmp=function(a,b)
if a>b then
return true
else
return false
end
end
table.sort(t,cmp)则t中的元素会从大到小排序.