摘要:
代码如下,里面有注释,应该能看懂。function getFile(file_name) local f = assert(io.open(file_name, 'r')) local string = f:read("*all") f:close() return str... 阅读全文
摘要:
转自:Lua模式匹配模式匹配函数在string库中功能最强大的函数是:string.find(字符串查找)string.gsub(全局字符串替换)string.gfind(全局字符串查找)string.gmatch(返回查找到字符串的迭代器)这些函数都是基于模式匹配的。与其他脚本语言不同的是,Lua... 阅读全文