Create text directly with single or double quotes.
Returns String — A new string value. Example label = "Start"
text(label)Convert a number, boolean, or other value to text. Large or deeply nested structured values use a bounded preview with explicit omission markers, while a direct string remains unchanged.
Returns String — Converted text value. Example attempt = 3
line = str(attempt)Count how many characters are in the string.
Returns Int — Character count.
Example label = "Play"
count = len(label) # returns 4Read one character by index. Negative indexes count from the end.
Returns String ? — One-character string, or None if out of range. Example label = "Play"
first = label[0] # returns 'P'
last = label[-1] # returns 'y'Copy a substring using Python-style slicing. Omitted bounds use the start or end; negative indexes count from the end.
Returns String — A new string slice, clamped to the available range. Example label = "abcdef"
middle = label[1:4] # returns 'bcd'
tail = label[-3:] # returns 'def'
reverse = label[::-1] # returns 'fedcba'Return a lowercase copy of the string.
Returns String — Lowercase string. Example label = "PLAY"
text(label.lower())Return an uppercase copy of the string.
Returns String — Uppercase string. Example label = "play"
text(label.upper())Trim whitespace, or the provided characters, from both ends.
Syntax string.strip(chars=None, /)Example label = " Play "
clean = label.strip()Trim whitespace, or the provided characters, from the left side.
Syntax string.lstrip(chars=None, /)Returns String — Left-trimmed string. Example label = "...Play"
clean = label.lstrip(".")Trim whitespace, or the provided characters, from the right side.
Syntax string.rstrip(chars=None, /)Returns String — Right-trimmed string. Example label = "Play..."
clean = label.rstrip(".")Check whether the selected slice starts with a prefix.
Syntax string.startswith(prefix, start=0, stop=len(string), /)Returns Boolean — true when the prefix matches.
Example label = "Play"
ready = label.startswith("Pl")Check whether the selected slice ends with a suffix.
Syntax string.endswith(suffix, start=0, stop=len(string), /)Returns Boolean — true when the suffix matches.
Example label = "Play"
ready = label.endswith("ay")Find the first substring index, or return -1 when absent.
Syntax string.find(sub, start=0, stop=len(string), /)Returns Int — First matching index, or -1.
Example label = "start button"
index = label.find("button")Find the first substring index and fail visibly when absent.
Syntax string.index(sub, start=0, stop=len(string), /)Returns Int — First matching index.
Example label = "start button"
index = label.index("button")Return a copy with occurrences of old text replaced.
Syntax string.replace(old, new, count=-1, /)Returns String — Updated string copy. Example label = "start start"
once = label.replace("start", "play", 1)Split a string into a list of text parts.
Syntax string.split(sep=None, maxsplit=-1, /)Returns list — List of string parts. Example raw = "a,b,c"
parts = raw.split(",")Join an iterable of strings using this string as the separator.
Example parts = ["a", "b", "c"]
line = ",".join(parts)Count non-overlapping substring occurrences.
Syntax string.count(sub, start=0, stop=len(string), /)Returns Int — Occurrence count.
Example label = "banana"
count = label.count("an")Check whether the string is non-empty and all characters are letters.
Returns Boolean — true for letters only.
Example label = "Play"
ok = label.isalpha()Check whether the string is non-empty and all characters are digits.
Returns Boolean — true for digits only.
Example value = "123"
ok = value.isdigit()Check whether the string is non-empty and all characters are letters or digits.
Returns Boolean — true for letters or digits only.
Example value = "A123"
ok = value.isalnum()Check whether the string is non-empty and all characters are whitespace.
Returns Boolean — true for whitespace only.
Example value = " "
ok = value.isspace()Iterate characters from left to right.
Returns None — No direct return value. Executes once per character.
Example word = "Go"
for ch in word:
text(ch)Check whether the string is empty or not.
Syntax if string | if not stringReturns Boolean condition — true when non-empty, false when empty.
Example value = ""
if not value:
text("empty")