标签:测试 mat return ring gmat res cti lis nil
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 str = "1234,389,abc";
local list = string.split(str, ",");
标签:测试 mat return ring gmat res cti lis nil
原文地址:http://www.cnblogs.com/y-rong/p/6165490.html