String Literal: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
(Created page with "See also: String. A '''string literal''' is not a variable. A string literal is a series of alpha-numeric characters encapsulated within quotes (single or double). S...")
 
(No difference)

Latest revision as of 19:45, 15 October 2013

See also: String.

A string literal is not a variable. A string literal is a series of alpha-numeric characters encapsulated within quotes (single or double). String literals are have many purposes in programming.

For example:

"This is a string literal"

or

'This is a string literal'

Quotes may be used inside of string literals. For example:

'This is a "string literal"'

or

"This is a ""string literal"""

The double quotes used in the example above evaluate to a single " in the value returned.