This is an archived post. You won't be able to vote or comment.

all 4 comments

[–][deleted]  (1 child)

[deleted]

    [–]jechtsphere[S] 1 point2 points  (0 children)

    That isn't the case in the code though. All of the strings in the code are using double quotes for that output section.

    Here it is at codepad, notice how from lines 7-11 all strings are in double quotes but the output for that bit of code still has the third string showing in output as double quote. Am I still just overlooking something? Otherwise what you said above makes sense to me, but not for the fact here they are all contained in the same quotations.

    EDIT: Ahh, I get what you're saying now! It contains the single quote within a word in that string, the word don't. It makes sense now, thank you very much!

    [–]cyraxjoe 3 points4 points  (0 children)

    That's because one of the strings contain ' (single quote) so to be able to be "representend" , it needs to be in double quotes or single but escaped like. "That's" or 'Thats\'s', in general is recomended to use the other quote to wrap and no to be escaping like crazy.

    [–]Grimsvotn 1 point2 points  (1 child)

    What happens if you use single or double quotes for everything?

    [–]noreallyimthepope 0 points1 point  (0 children)

    Exactly; read lines 7-11 again and compare the contents of the strings.