function string.split(str, delimiter) if str==nil or str=='' or delimiter==nil then return nil end local result = {} for match in (str..delimiter):gmatch("(.-)"..delimiter) do table.insert(result, match) end r…
local function split(str, d) --str是需要查分的对象 d是分界符 local lst = { } local n = string.len(str)--长度 local start = 1 while start <= n do local i = string.find(str, d, start) -- find 'next' 0 if i == nil then table.insert(lst, string.sub(str, start, n)) bre…