Strings
String represents valid UTF-8 text. Write a string literal between double quotation marks:
local language = "Pop"local greeting = "Olá, mundo!"local symbol = "🫧"Non-ASCII text is preserved. The compiler and runtime do not replace valid Unicode text with a byte-oriented approximation.
Escapes
Section titled “Escapes”Quoted strings accept portable escapes such as \\, \", \n, \r, \t, \0, \x41, and \u{1FAE7}:
local twoLines = "first\nsecond"local quoted = "say \"Pop\""local bubble = "\u{1FAE7}"Concatenation
Section titled “Concatenation”The Luau-shaped .. operator joins two strings:
local directory = "src"local path = directory .. "/main.pop"The numeric + operator intentionally does not concatenate strings. Convert a primitive explicitly before joining it:
local count = 3local message = "count=" .. String(count)String(value) formats String, Boolean, and every integer or floating-point primitive. It is not a universal toString operation and rejects arrays, tables, records, classes, and functions.
Interpolation
Section titled “Interpolation”Backticks interpolate the same closed primitive set. Expressions inside braces are evaluated from left to right:
local count = 3local enabled = truelocal summary = `count={count}, enabled={enabled}`Use \{, \}, and \`` for literal interpolation punctuation inside backticks. ${value}` is not Pop syntax.
Equality
Section titled “Equality”== compares string contents, and ~= tests that the contents differ:
local expected = "Pop"local actual = "Pop"local same = expected == actual -- trueThe comparison is by UTF-8 value, not by the identity of the managed string objects.
Printing
Section titled “Printing”The Standard foundation provides print(String), which writes the string followed by a newline:
print("one line")print("another line")Alongside print(Int), this is the complete general output overload surface in rc.3. Concatenation, interpolation, and primitive formatting are language operations; library APIs for slicing, searching, changing case, parsing numbers, and inspecting Unicode characters are not yet exposed.
String composition may allocate managed storage. Formatting is deterministic and locale-independent: booleans use true/false, integers use base ten, and floating-point values use portable spellings including nan, inf, and -inf.
The String composition and formatting leaf collects the practical choice between .., backticks, and String(value).
