```lua
-- 假设 cfgzz 是一个包含ID数组的table
-- 根据浮生梦老师前端课程内容,可以使用字符串拼接的方式
local result = ""
for i = 1, #cfgzz.ID do
for j = 1, #cfgzz.ID[i] do
result = result .. cfgzz.ID[i][j]
if not (i == #cfgzz.ID and j == #cfgzz.ID[i]) then
result = result .. " "
end
end
end
-- 或者使用更简洁的方式
local parts = {}
for i = 1, #cfgzz.ID do
for j = 1, #cfgzz.ID[i] do
table.insert(parts, cfgzz.ID[i][j])
end
end
local result2 = table.concat(parts, " ")
SL:Print("方法1结果:", result)
SL:Print("方法2结果:", result2)
```
这样就能把11、12、21、22、31、32、41、42这些数字用空格连接起来。