Skip to content
Konjure / spatial intelligence

String

← Builtin reference

Immutable UTF-8 text with canonical language type Str (String is an alias).

Signature

Clones share an Arc allocation. Concatenation creates a new value without implicit conversion. len, indexing, and slices count Unicode scalar values, while allocation limits count UTF-8 bytes. utf8 encodes to Bin and decode validates Bin as UTF-8. Text is the separate visible scene component.

Methods

len

len() -> f64

Returns the receiver's element, byte, or Unicode scalar count.

utf8

utf8() -> Bin

Encodes text as immutable UTF-8 bytes.

get

get(f64) -> Opt[Str]

Returns Some(value) for a valid index and None otherwise.

Examples

Read existing source

The compatibility spelling resolves to the same immutable text type.

Tick 0 · 0.00 s⌘ / Ctrl + EnterThis device
main.kj
Loading the language runtime…
Output 0
No output.
Expected output
text

Rust definition

Compatibility spelling of Str; new source uses Str.

See also