meta data for this page
  •  

Quotes

No difference between ' and “. If you want to use ' inside string, use ” and vice versa. Lua handles backslash as escape character:

\a	bell
\b	back space
\f	form feed
\n	newline
\r	carriage return
\t	horizontal tab
\v	vertical tab
\\	backslash
\"	double quote
\'	single quote
\[	left square bracket
\]	right square bracket

Also ASCII decimal value can be specified after backslash \ddd

print ("my new string")
print ('my new string')
print ('my new string with double quote " inside')
print ("my new string with single quote ' inside")
print ('my new string with single quote \' inside')
print ('my new string with single quote \\\' inside') -- will print "... \' ..."
print ('my new string with single quote \039 inside')
-- to treat string as literal, and do not handle escape character , use square brackets [[...]]
print ([[my new string with single quote \' inside]]) -- will print "... \' ..."