POLYTONE — the AI-native programming language

Guide

Text & interpolation

There is one way to compose text: interpolation. "{expr}" evaluates any expression into the string — Text has no + operator.

text.pt
let raw = "  Poly, Tone  "
let clean = raw.trim()
print(clean.upper())
print("{clean.split(", ")}")
print("{clean.len()} chars, starts with Poly: {clean.starts_with("Poly")}")

Text methods cover the everyday needs: len, upper, lower, trim, contains, starts_with, ends_with, split, replace, chars, and the fallible parsers to_int / to_float, which return an Option instead of throwing. The full list lives in the Prelude explorer.