print("Type "exit" To Exit")
[Lua] Print Quotes
Started by Sirharry0077, Feb 16 2013 07:58 AM
4 replies to this topic
#1
Posted 16 February 2013 - 07:58 AM
How would you go about doing the following without error?
#2
Posted 16 February 2013 - 08:16 AM
simple fix, use this
There's two types of string syntax for printing, there the single quote ' and double quote " if you want to print a double quote the surround the rest of the string in a single quote and visa versa
Hope this helps you
print('Type "exit" to exit')
There's two types of string syntax for printing, there the single quote ' and double quote " if you want to print a double quote the surround the rest of the string in a single quote and visa versa
Hope this helps you
#3
Posted 16 February 2013 - 08:34 AM
And of course you can just escape it
print("this is a quotation mark: \" - what a surprise!")
#4
Posted 16 February 2013 - 08:43 AM
I'll go ahead and add that you can use double brackets too. They're best for strings in multiple lines, and maybe if you want to use both double and single quotes.
s = [[ a string with mutiple lines with 'single' and "double" quotes! ]]
#5
Posted 16 February 2013 - 08:47 AM
Thx guys everything you posted is helpful.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











