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