1. 直接通过字符串创建函数 (不太灵活)
var str = String(Array);
结果
[1,2,3,'a']
2. 拼接字符串数组(内置推荐)
var str = PoolStringArray(Array).join("")
结果
123a
3. 自定义函数(通用实现)
func arr_join(arr, separator = ""):
var output = "";
for s in arr:
output += str(s) + separator
output = output.left( output.length() - separator.length() )
return output
func arr_join2(arr):
var complete = ""
for i in range(0,strings.size()):
complete += strings[i]
return complete