Hey there, I see alot in scripting using double quotes, and some people using single quotes. What is better to use?
Should I use single quote, or double quote when scripting?
1 answer
Neither one makes a difference.
The only issue that could arise is you using two different quotes or the same quote twice in a string, in which case you can just escape that character:
print("I said \"Hello\" to somebody")
Single and double quotations are significantly different in other languages, but in Lua, they ultimately make no difference. So, there is no bias here; go with whichever one pleases you the most.
Speaking of which, here's a demonstration of said quotes in a string:
print("I said 'Hello'")
When Lua reads this, it reads the double quotes as the start and end of the string and it interprets the single quotes as standard characters. The same can be said if you flip the quotation marks, only in reverse:
print('I said "Hello"')
Again, they don't make a difference.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Yep.
there's also [[ ]]