Double quoted strings

Double quoted strings are written between double quotes.

"This is a double quoted string"

means

This is a double quoted string

Advantages:

  • Can contain colons (:) followed by a space or a hashtag (#) after a space.
  • Can contain single quotes (') without having to escape them.
  • Newlines can be added by placing an escape character (\) at the end of the line.

Disadvantages:

  • Can't contain double quotes ("). They need to be escaped with a backslash (\).
  • Backslashes (\) are interpreted as escape characters. This means that you can't write a string containing a backslash without escaping it.
    • Special characters like newlines and tabs are interpreted as escape characters.
    • Makes it hard to type a string containing jme commands. Because you will need to escape each backslash.
"It's a double quoted string with a jme simplify command \\simplify{2x+3}"

means

It's a double quoted string with a jme simplify command \simplify{2x+3}

We need to write two backslashes to get one backslash in the string. This is because the backslash is used as the escape character. If we want to type a backslash in the string we need to escape it with another backslash.