发帖
充值
 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
0 1

读取字符串存为数组保存到指定目录文本

源码分享 2505 0 2023-4-21 05:21:57

function 读取字符串存为数组(路径)
        if fileExist(存储路径)==false then
                local file = io.open(存储路径, "w")--w创建文件
                file:close()--w关闭文件
        end
        t={}
        io.input(存储路径)
        while true do
                local ReadContent = io.read()
                if ReadContent == null then
                        break
                else
                end
                table.insert(t,ReadContent)
        end
        if t[1]==nil then
                io.close()
                return nil
        else
                io.close()
                return t
        end
end

使用道具 举报

您需要登录后才可以回帖 立即登录
高级模式
返回
源码分享