这个lua函数是什么意思
functionsplit(target,sep)iftarget==nilthenreturn{}endlocalsep,fields=sepor":",{}local...
function split(target, sep)
if target == nil then return {} end
local sep, fields = sep or ":", {}
local pattern = "([^"..sep.."]+)"
target:gsub(pattern, function(c) table.insert(fields, c) end)
return fields
end 展开
if target == nil then return {} end
local sep, fields = sep or ":", {}
local pattern = "([^"..sep.."]+)"
target:gsub(pattern, function(c) table.insert(fields, c) end)
return fields
end 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询