lua-users home
lua-l archive

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


On Sat, Jun 5, 2010 at 1:02 PM, Graham Wakefield <wakefield@mat.ucsb.edu> wrote:
> Hmm, I must be slow. I can't figure out how to convert a string with represented control characters into a string with actual control characters.
>
> E.g.:
>
> local input = [[ line 1\nline2 ]]
>

I think loadstring() may be the simplest solution.

you may need to use double quotes for the string, and you should quote
all double quotes inside the string .  Using single quotes is the
same.

Use [[ and ]] are not recommended, since it cannot be quoted and will
have security problem when used with loadstring().