![](https://iknow-base.cdn.bcebos.com/lxb/notice.png)
lua 怎么将字符串有“,”分割呢?
1个回答
展开全部
从<lua程序开发>中抄一段给你
local t = {} -- table to store the indices
local i = 0
while true do
i = string.find(s, "\n", i+1) -- find 'next' newline
if i == nil then break end
table.insert(t, i)
end
local t = {} -- table to store the indices
local i = 0
while true do
i = string.find(s, "\n", i+1) -- find 'next' newline
if i == nil then break end
table.insert(t, i)
end
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询