lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Fri, Jun 4, 2010 at 11:14 PM, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
>> local input = [[line1\nline2]]
>> local output = loadstring("return \"" .. input .. "\"")()
>
> Does not work if input contains double quotes.
>

----
local input = [["line1"\nline2]]
input = input:gsub([["]], [[\"]])
local output = loadstring("return \"" .. input .. "\"")()
----


~Jonathan