function split(s, delim)
if type(delim) ~= "string" or string.len(delim) <= 0 then
return
end
local start = 1
local t = {}
while true do
local pos = string.find (s, delim, start, true) -- plain find
if not pos then
break
end
table.insert (t, string.sub (s, start, pos - 1))
start = pos + string.len (delim)
end
table.insert (t, string.sub (s, start))
return t
end
标签:
Lua,split函数
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“Lua实现split函数”评论...