+ 1
I wonder what the differrence between ' and " is
It seems both of them can be used when it comes to a string.Am I right? Thanks.
2 Réponses
+ 7
Both can be used however there are slight differences. Eg ' can be confused with an apostrophe so if you are printing the string 'don't do that' the computer will see the apostrophe in the don't as the end of the string. There are ways to get around this such as using a backslash(\ )before the apostrophe in don't.
Eg: print 'don\'t do that'
The backslash tells the computer to ignore the apostrophe and see it as part of the string. Another way of printing the string is to simply use double quotes eg:
Print "Don't do that"
- 1
yeah that is escape. You should know bout escape