add split

pull/63/head
ibuler 2016-06-19 10:50:49 +08:00
parent 3331d86e98
commit fb0f32b9ec
1 changed files with 11 additions and 10 deletions

View File

@ -239,17 +239,18 @@ end
-- return match(header, ";%s*boundary=([^\",;]+)")
-- end
-- function string.split(str, delimiter)
-- if str==nil or str=='' or delimiter==nil then
-- return nil
-- end
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
return result
end
-- local result = {}
-- for match in (str..delimiter):gmatch("(.-)"..delimiter) do
-- table.insert(result, match)
-- end
-- return result
-- end
function innet(ip, network)
local star = ''