function _M.split(str, split_char)
if str == nil or str == "" or split_char == nil then
return nil
end
local t = {}
for m in (str..split_char):gmatch("(.-)".. split_char) do
table.insert(t, m)
end
return t
endlua string 分割字符串
解析Lua字符串分割函数M.split
最新推荐文章于 2024-09-18 21:30:00 发布
本文详细解读了Lua中用于字符串分割的函数M.split,包括其参数处理、实现细节及使用方法。
610

被折叠的 条评论
为什么被折叠?



