remove
Builtin index · Collections & strings
result =remove(s, text)orremove(s, start, [count])
Input: s, text · Output: result
What it is
s is a Str. Two overloads, picked by the type of the second argument: text (Str) deletes every occurrence of it; start (number, 0-based index) with optional count (number of characters, default: to the end) deletes that run instead.
Overloads
3 forms. Each carries its own inputs, outputs and worked example — pick the tab for the one you are calling.
| Code | Input | Output | Description |
result = remove(s, text) | s Strs is a Str.text Strtext is a Str. | result Str | text is a Str. Deletes every occurrence of it from s. |
Examples
From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.
s = "hello, world"
print(remove(s, ", ")) # "helloworld" -- every occurrence of the text
print(remove(s, 0, 5)) # ", world" -- 5 characters starting at position 0
print(remove(s, 7)) # "hello, " -- position 7 to the end, count omitted
helloworld , world hello,
from collections-strings
| Code | Input | Output | Description |
result = remove(s, start) | s Strs is a Str.start numberstart (number, 0-based index) with optional count (number of characters, default: to the end) deletes that run instead. | result number | start is a number (0-based character index). Deletes from start to the end of s. |
Examples
From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.
s = "hello, world"
print(remove(s, ", ")) # "helloworld" -- every occurrence of the text
print(remove(s, 0, 5)) # ", world" -- 5 characters starting at position 0
print(remove(s, 7)) # "hello, " -- position 7 to the end, count omitted
helloworld , world hello,
from collections-strings
| Code | Input | Output | Description |
result = remove(s, start, count) | s Strs is a Str.start numberstart (number, 0-based index) with optional count (number of characters, default: to the end) deletes that run instead.count numbercount is a number of characters. | result number | count is a number of characters. Deletes exactly that many, starting at start, clamped rather than erroring if count runs past what's left. |
Examples
From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.
s = "hello, world"
print(remove(s, ", ")) # "helloworld" -- every occurrence of the text
print(remove(s, 0, 5)) # ", world" -- 5 characters starting at position 0
print(remove(s, 7)) # "hello, " -- position 7 to the end, count omitted
helloworld , world hello,
from collections-strings
How it works
remove(t) — permanently deregisters t from any on elapsed/on elapsedOnce firing (checked live by run_for); unlike stop, this cannot be undone by calling start again. elapsed(t)/start(t)/etc. still work on the handle afterward (still a valid timer for plain profiling use) — remove only affects the simulated-event registration. remove(collection, index) — collection form (§ collections, 2026-08-24): returns a NEW list/vector with the element at index dropped. Dispatches on arg0's type rather than a separate name (the same "one name, arg-type decides" pattern zeros/find already use in this file) — remove(t) on a Timer keeps its exact prior meaning below, unchanged. Same immutable-return convention as insert/append: Qu values are immutable by convention everywhere else, and there is no in-place list.remove(i).
From the note above this builtin in the interpreter, where the reasoning was written down as it was built.