String Values
A string is a string of character(s) enclosed in quotation marks. The quotation marks can either be single quotation marks or double quotation marks. This 'sample' illustrates single quotation marks and this "sample" illustrates double quotation marks.
- Single quotation marks can occur between double quotation marks, and double quotation marks can occur between single quotation marks.
- "This 'sample' is correct."
- 'This "sample" is correct.'
- Single quotation marks cannot occur between single quotation marks unless they are proceeded by a backslash \.
- 'This 'sample' is wrong.'
- 'This \'sample\' is correct.'
- Double quotation marks cannot occur between double quotation marks unless they are proceeded by a backslash \.
- "This "sample" is wrong."
- "This \"sample\" is correct."