Is there any difference between single and double quoted strings in ActionScript?
+2
A:
No, apart from it being easier to include single quotes in double quoted strings and vice versa.
Jørn Schou-Rode
2010-01-15 17:38:21
+2
A:
No difference.
That is from ActionScript: The definitive Guide
String is the datatype used for textual data (letters, punctuation marks, and other characters). A string literal is any combination of characters enclosed in quotation marks:
"asdfksldfsdfeoif" // A frustrated string
"greetings" // A friendly string
"[email protected]" // A self-promotional string
"123" // It may look like a number, but it's a string
'singles' // Single quotes are acceptable too
Diego Dias
2010-01-15 17:41:33
+6
A:
You can use either as delimiter for a string. They are however not interchangeable, i.e. you can't start a string with an apostrophe and end it with a quotation mark.
The only difference is which characters you need to escape. Inside a string delimited by quotation marks you need to escape quotation marks but not apostrophes, and vice versa.
To put the text He said "It's all right" and laughed.
in a string you can use:
"He said \"It's all right\" and laughed."
or:
'He said "It\'s all right" and laughed.'
Guffa
2010-01-15 17:41:34