Just in case, you would like to run away and quote:
function string.quote(str)
return '"' .. str:gsub('\\', '\\\\'):gsub('"', '\\"') .. '"'
end
local a = '"Hello again \\ to all my friends"'
print(a:quote())
Which will give you the following line:
"\"Hello again \\ to all my friends\""
source
share