
lua
QF_
这个作者很懒,什么都没留下…
展开
-
lua 分割字符串
转自 :http://zhaiku.blog.51cto.com/2489043/1163077string.split = function(s, p) local rt= {} string.gsub(s, '[^'..p..']+', function(w) table.insert(rt, w) end ) return rtend使用例子一local str =转载 2017-09-29 14:20:06 · 3469 阅读 · 0 评论 -
lua判断目录存在,创建目录
判断目录或文件是否存在function file_exists(path) local file = io.open(path, "rb") if file then file:close() end return file ~= nilend创建目录os.execute("mkdir ooxx\\ooxx\\ooxx\\ooxx) --windowsos.execute("mkdi原创 2017-09-29 16:41:09 · 16717 阅读 · 0 评论