Type Strpub
:type(pub) Str
Conversions
Conversions to
Implementations
impl Str
impl Str
.as-bytes ( Str → Bytes )
.as-bytes ( Str → Bytes )
.as-bytes — zero-copy-style view of the receiver's UTF-8 encoding. Runtime shape matches .bytes: a plain Bytes cell. The "zero-copy" guarantee is a forward-compatibility contract; today the implementation allocates a fresh Bytes over the byte view.
.byte-at ( Str (Int ..) → (Option (Int 0..)) )
.byte-at ( Str (Int ..) → (Option (Int 0..)) )
.byte-at — byte at index as (Option AnyUInt) (the byte value 0..256).
.bytes ( Str → Bytes )
.bytes ( Str → Bytes )
.bytes — return the UTF-8 encoding as a Bytes cell. Eager Bytes form; the spec's lazy (Iterator U8) form lives on the core Str type.
.char-at ( Str (Int ..) → (Option Codepoint) )
.char-at ( Str (Int ..) → (Option Codepoint) )
.char-at — nth codepoint (0-indexed) as (Option Codepoint).
.char-count ( Str → (Int ..) )
.char-count ( Str → (Int ..) )
.char-count — count of Unicode codepoints (distinct from .len, which is the UTF-8 byte count).
.chars ( Str → (Vec Codepoint) )
.chars ( Str → (Vec Codepoint) )
.chars — enumerate the Unicode codepoints of the receiver into a (Vec Codepoint). Eager Vec complement of the spec's lazy .codepoints iterator.
.contains ( Str m → Bool )
.contains ( Str m → Bool )
.contains — true iff m matches anywhere in the receiver. Accepts any (CodepointMatcher m); delegates to .find and projects presence.
.find ( Str m → (Option (Int ..)) )
.find ( Str m → (Option (Int ..)) )
.find — byte offset of the first occurrence of m in the receiver, or None if m does not match. Accepts any (CodepointMatcher m): the built-in Str, Codepoint, (Vec Codepoint), or a predicate quotation. Delegates to .find-in and projects the start offset.
.lines ( Str → (Vec Str) )
.lines ( Str → (Vec Str) )
.lines — split by newline (\n, \r\n, \r); trailing newline does not emit an extra empty element.
.pad-left ( Str (Int ..) Codepoint → Str )
.pad-left ( Str (Int ..) Codepoint → Str )
.pad-left — left-pad with fill until .codepoints .count >= width.
.pad-right ( Str (Int ..) Codepoint → Str )
.pad-right ( Str (Int ..) Codepoint → Str )
.pad-right — right-pad with fill until codepoint-count >= width.
.repeat ( Str (Int ..) → Str )
.repeat ( Str (Int ..) → Str )
.repeat — concatenate the receiver N times (0 or negative yields "").
.rfind ( Str Str → (Int ..) )
.rfind ( Str Str → (Int ..) )
.rfind — byte offset of the last occurrence, or -1 if not found. Still takes a literal Str pending a backward-scanning Matcher variant.
.split ( Str Str → (Vec Str) )
.split ( Str Str → (Vec Str) )
.split — split by a Str separator into a (Vec Str). Mirrors the core split word with .method dispatch.
.split-once ( Str Str → (Option (Pair Str Str)) )
.split-once ( Str Str → (Option (Pair Str Str)) )
.split-once — split at the first occurrence of a Str separator, returning Some (Pair left right) (separator excluded) or None when the separator is absent. This is the literal-Str form; the full spec signature uses a Matcher constraint, which is deferred until Matcher trait rewiring lands.
.split-whitespace ( Str → (Vec Str) )
.split-whitespace ( Str → (Vec Str) )
.split-whitespace — split on runs of Unicode whitespace, dropping empties. Equivalent in content to .words; returned eagerly as a (Vec Str) pending a lazy iterator surface for Str sources.
.strip-prefix ( Str Str → (Option Str) )
.strip-prefix ( Str Str → (Option Str) )
.strip-prefix — remove the prefix if present; Some rest or None.
.strip-suffix ( Str Str → (Option Str) )
.strip-suffix ( Str Str → (Option Str) )
.strip-suffix — remove the suffix if present; Some rest or None.
.to-utf16 ( Str → (Vec (Int 0..)) )
.to-utf16 ( Str → (Vec (Int 0..)) )
.to-utf16 — encode as UTF-16 code units. Returns (Vec AnyUInt) — each element is a UTF-16 code unit in the range 0..65536. The concrete U16 alias is not used in the signature because alias normalisation during signature registration conflicts with the intrinsic's existential bound on the element type.
Trait Implementations
impl Add Str for Str | Str
impl Debug for Str
impl Default for Str
impl Display for Str
impl Eq Str for Str
impl Hash for Str
impl Into Str for Str
impl Into Str for Str
impl Matcher Str Codepoint for Str
Str is a matcher that matches itself byte-identically inside another Str. .find-in delegates to the host str-find intrinsic and shapes the byte offset into Some (RangeBoth start end) or None. .find-all-in walks the input with successive slices.