function split(s, delim)
if type(delim) ~= "string" or string.len(delim) <= then
return
end local start =
local t = {}
while true do
local pos = string.find (s, delim, start, true) -- plain find
if not pos then
break
end table.insert (t, string.sub (s, start, pos - ))
start = pos + string.len (delim)
end
table.insert (t, string.sub (s, start)) return t
end
相关文章
- JS:JS中常见的 “函数名 is not a function” 错误
- 面试问题 - SQL 中存储过程与函数的区别
- 如何使用 TP中的公共函数 (定义在common/common.php中的函数)
- C++进阶--析构函数中的异常
- oracle函数nvl,nvl2的区别,nullif函数,coalesce函数
- MySQL中的IFNULL,IF,NULLIF函数
- jQuery的$.get()函数不执行以及php端报错Uncaught Error: Call to a member function bind_param() on boolean in...
- 比较好用的php函数
- MySQL自定义函数与存储过程的创建、使用、删除
- 归纳整理Linux下C语言常用的库函数----文件操作