函数:table.concat 数组连接
函数名称:连接数组
函数功能:连接数组
函数方法
str = table.concat (tb,sep,i, j)
必填
参数 | 类型 | 说明 |
---|---|---|
tb | table | 待操作数组 |
sep | string | 分割的字符 |
选填
参数 | 类型 | 默认值 | 说明 |
---|---|---|---|
i | number | 否 | 1 |
j | number | 否 | #tb |
返回值
返回值 | 类型 | 说明 |
---|---|---|
str | string | 连接后的字符串 |
函数示例
tb = {"a","b","c","d",1,2,3,4}
str = table.concat(tb,"|")
nLog(str)