Hymn Script
Home Learn Play Download Source Light

Strings



A string is an array of characters used to represent text. Literal strings are surrounded in either single or doubles quotes.

'hello hymn'
"hello hymn"

Strings can be written across multiple lines. Spaces are preserved.

"hello
  across
  the
world"

Escape characters in strings using a backslash.

"foo \"quote\" bar"
"foo \n new line bar"

Adjacent strings are automatically bunched together.

"I" " am " "one" " string"

A dollar sign and curly brackets are used to execute code and concatenate an expression within a string.

>>> set x = 42
>>> echo "The answer is ${x}"
The answer is 42

>>> echo "The answer doubled is ${x * 2}"
The answer doubled is 84

>>> echo "An escaped \${ string"
An escaped ${ string

Back to Primitives Learn Lists