Strings

The syntax for creating string items is conformant to JSON rather than to the W3C standard for string literals. This means concretely that escaping is done with backslashes and not with ampersands. Also, like in JSON, double quotes are required and single quotes are forbidden.

Figure 16. StringLiteral

StringLiteral

Example 19. String literals

  "foo"
        

Result: foo


Example 20. String literals with escaping

  "This is a line\nand this is a new line"
        

Result: This is a line and this is a new line


Example 21. String literals with Unicode character escaping

  "\u0001"
        

Result: 


Example 22. String literals with a nested quote

  "This is a nested \"quote\""
        

Result: This is a nested "quote"