Text reference
The 19 functions and 0 values of text: signature, effects, phase, cost and tested examples.
Build, search and change text.
Functions#
text.contains#
text.contains(text, part)
True when text holds part.
- Effects: none: the result depends on the arguments only.
- Phase: every bar.
- Cost: a fixed number of operations.
text.ends_with#
text.ends_with(text, part)
True when text ends with part.
- Effects: none: the result depends on the arguments only.
- Phase: every bar.
- Cost: a fixed number of operations.
text.fmt#
text.fmt([value], [spec], [fallback], [zone])
A value written as text by a format spec, with a fallback for na.
- Effects: builds a new value whose size follows its arguments (counted in the memory ledger).
- Phase: every bar.
- Cost: allocates: the memory ledger counts what it builds.
text.format#
text.format([pattern], ...values)
Fills {0}, {1} in pattern with the values after it.
- Effects: builds a new value whose size follows its arguments (counted in the memory ledger).
- Phase: every bar.
- Cost: allocates: the memory ledger counts what it builds.
- Examples: Levels from text.
text.format_time#
text.format_time([time], [pattern], [zone])
A time value written by a pattern, in a zone.
- Effects: builds a new value whose size follows its arguments (counted in the memory ledger).
- Phase: every bar.
- Cost: allocates: the memory ledger counts what it builds.
text.index_of#
text.index_of(text, part)
The position of the first part in text, or -1.
- Effects: none: the result depends on the arguments only.
- Phase: every bar.
- Cost: a fixed number of operations.
text.length#
text.length(text)
The number of characters of text.
- Effects: none: the result depends on the arguments only.
- Phase: every bar.
- Cost: a fixed number of operations.
text.lower#
text.lower(text)
The text in lower or upper case.
- Effects: builds a new value whose size follows its arguments (counted in the memory ledger).
- Phase: every bar.
- Cost: allocates: the memory ledger counts what it builds.
text.match#
text.match([text], [pattern])
Matches text against a pattern.
- Effects: builds a new value whose size follows its arguments (counted in the memory ledger).
- Phase: every bar.
- Cost: allocates: the memory ledger counts what it builds.
text.of#
text.of(value, [format])
A value written as text, in a given format.
- Effects: builds a new value whose size follows its arguments (counted in the memory ledger).
- Phase: every bar.
- Cost: allocates: the memory ledger counts what it builds.
text.repeat#
text.repeat(text, count, [separator])
The text repeated count times, with separator between.
- Effects: builds a new value whose size follows its arguments (counted in the memory ledger).
- Phase: every bar.
- Cost: allocates: the memory ledger counts what it builds.
text.replace#
text.replace(text, target, replacement, [occurrence])
Replaces one occurrence of target.
- Effects: builds a new value whose size follows its arguments (counted in the memory ledger).
- Phase: every bar.
- Cost: allocates: the memory ledger counts what it builds.
text.replace_all#
text.replace_all(text, target, replacement)
Replaces every occurrence of target.
- Effects: builds a new value whose size follows its arguments (counted in the memory ledger).
- Phase: every bar.
- Cost: allocates: the memory ledger counts what it builds.
- Examples: Levels from text.
text.slice#
text.slice(text, from, [to])
The part of text from from to to.
- Effects: builds a new value whose size follows its arguments (counted in the memory ledger).
- Phase: every bar.
- Cost: allocates: the memory ledger counts what it builds.
text.split#
text.split(text, separator)
Splits text at separator into an array.
- Effects: builds a new value whose size follows its arguments (counted in the memory ledger).
- Phase: every bar.
- Cost: allocates: the memory ledger counts what it builds.
- Examples: Levels from text.
text.starts_with#
text.starts_with(text, part)
True when text begins with part.
- Effects: none: the result depends on the arguments only.
- Phase: every bar.
- Cost: a fixed number of operations.
text.to_number#
text.to_number(text)
The number written in text, or na.
- Effects: none: the result depends on the arguments only.
- Phase: every bar.
- Cost: a fixed number of operations.
- Examples: Levels from text.
text.trim#
text.trim(text)
The text without spaces at either end.
- Effects: builds a new value whose size follows its arguments (counted in the memory ledger).
- Phase: every bar.
- Cost: allocates: the memory ledger counts what it builds.
- Examples: Levels from text.
text.upper#
text.upper(text)
The text in lower or upper case.
- Effects: builds a new value whose size follows its arguments (counted in the memory ledger).
- Phase: every bar.
- Cost: allocates: the memory ledger counts what it builds.