Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Strings and interpolation

Put a value inside text with {…}, the way you would write it in a prompt:

name = "Ada"
say "Hello, {name}! You have {count of tasks} tasks."

Anything that works as an expression works inside the braces: "{price * 2}", "{upper name}". Write {{ or }} for a literal brace. Braces are only allowed inside text. Code structure stays brace-free (P013).

You can also join text with + or plus:

say "Hello, " + name
greeting = "Hi " plus name

In say and print, adjacent parts are joined in order:

set total to 14
say "Total: " total

See Lists, text, and numbers for upper, lower, trim, join, and split.