跳到主要内容

替换某一行的内容(file.resetLineText)

函数

状态 = file.resetLineText(文件路径, 行数, 文本内容)

参数

  • 文件路径 文本型

  • 行数 整数型

  • 文本内容 文本型

返回值

  • 状态 布尔值

说明

用于替换文件 的某行内容

示例

if file.resetLineText("/var/mobile/Media/1.txt" , 1 ,"新的内容") then
print("替换成功")
end