lua 变量包含-无法匹配
从文件中读出一行字符串,在out_buffer中将该字符串删除,当字符串包含-时无法匹配
像"ABC-L"这样的字符串在out_buffer中就无法删除,怎么使变量不要被模式转换?
代码如下:
while true do
local line = f_in:read("*line")
if not line then break end
local count
out_buffer, count = string.gsub(out_buffer, line, "")
if count == 0 then print(line) end
end