std.str [core] std.str.len pub fn len(s: str) -> int — The length of s in BYTES, O(1) — the honest unit (D25). std.str.is_empty pub fn is_empty(s: str) -> bool — Whether s holds no bytes. std.str.get pub fn get(s: str, from: int, to: int) -> str ! {none} — The bytes in [from, to) — the RECOVERABLE slice, and the primitive the rest of this module is written over ([mem.str.get], D25's anti-landmine form). std.str.bytes pub fn bytes(s: str) -> List[byte] — The raw bytes of s, in order, as the 0..255 element values §11's interim byte currency uses — std.bytes is the module that operates on them and bytes.from_str is the same view from that side. std.str.contains pub fn contains(s: str, needle: str) -> bool — Whether needle occurs anywhere in s, as a byte sequence. std.str.find pub fn find(s: str, needle: str) -> int ! {none} — The byte offset of the FIRST occurrence of needle in s; none when it does not occur. std.str.rfind pub fn rfind(s: str, needle: str) -> int ! {none} — The byte offset of the LAST occurrence of needle in s; none when it does not occur. std.str.find_all pub fn find_all(s: str, needle: str) -> List[int] — The byte offsets of every NON-OVERLAPPING occurrence of needle, left to right — the find-all family's one member, and the plural of find rather than a new vocabulary. std.str.count pub fn count(s: str, needle: str) -> int — The number of NON-OVERLAPPING occurrences of needle in s, scanning left to right — "aaa" contains one "aa", not two. std.str.starts_with pub fn starts_with(s: str, prefix: str) -> bool — Whether s begins with prefix. std.str.ends_with pub fn ends_with(s: str, suffix: str) -> bool — Whether s ends with suffix. std.str.starts_with_any pub fn starts_with_any(s: str, prefixes: List[str]) -> bool — Whether s begins with ANY of prefixes — the set form of starts_with, for the switch a parser writes over a keyword list. std.str.ends_with_any pub fn ends_with_any(s: str, suffixes: List[str]) -> bool — Whether s ends with ANY of suffixes — the set form of ends_with, for the extension test a file walker writes. std.str.strip_prefix pub fn strip_prefix(s: str, prefix: str) -> str ! {none} — s without a leading prefix; none when s does not start with it — the absence row rather than s unchanged, so the caller can tell the two apart (§2). std.str.strip_suffix pub fn strip_suffix(s: str, suffix: str) -> str ! {none} — s without a trailing suffix; none when it is not there — the absence row for strip_prefix's reason (§2). std.str.split pub fn split(s: str, sep: str) -> List[str] — Every piece of s between occurrences of sep, in order, keeping empty pieces: split("a,,b", ",") is three pieces and split("", ",") is one empty piece. std.str.splitn pub fn splitn(s: str, sep: str, n: int) -> List[str] — split stopping after n pieces: at most n are produced and the LAST one keeps the whole unsplit remainder, separators and all. std.str.rsplit pub fn rsplit(s: str, sep: str) -> List[str] — split's pieces in REVERSE order — last piece first. std.str.split_once pub fn split_once(s: str, sep: str) -> (str, str) ! {none} — The pieces of s before and after the FIRST occurrence of sep; none when sep does not occur — the pair is only meaningful together, so absence is one row and not two empty strings (§2). std.str.rsplit_once pub fn rsplit_once(s: str, sep: str) -> (str, str) ! {none} — split_once at the LAST occurrence of sep: the pieces before and after it, or none when it does not occur. std.str.replace pub fn replace(s: str, old: str, new: str) -> str — A fresh string with every NON-OVERLAPPING occurrence of old replaced by new, left to right, allocated in the ambient region. std.str.replacen pub fn replacen(s: str, old: str, new: str, n: int) -> str — replace stopping after n replacements; the rest of s is copied unchanged. std.str.lower pub fn lower(s: str) -> str — s with every code point lowercased, freshly allocated in the ambient region. std.str.upper pub fn upper(s: str) -> str — s with every code point uppercased, freshly allocated in the ambient region. std.str.eq_ignore_case pub fn eq_ignore_case(a: str, b: str) -> bool — Whether a and b are equal ignoring case, by comparing their case-folded forms. std.str.repeat pub fn repeat(s: str, n: int) -> str — s repeated n times, freshly allocated. std.str.trim pub fn trim(s: str) -> str — s with leading and trailing whitespace removed — a slice of s, no copy. std.str.trim_start pub fn trim_start(s: str) -> str — s with LEADING whitespace removed — a slice of s, no copy. std.str.trim_end pub fn trim_end(s: str) -> str — s with TRAILING whitespace removed — a slice of s, no copy. std.str.lines pub fn lines(s: str) -> List[str] — The lines of s, in order, each without its terminator. std.str.words pub fn words(s: str) -> List[str] — The whitespace-separated words of s, in order, dropping empty runs: any run of whitespace separates, leading and trailing whitespace produce no empty words, and a string of only whitespace has no words. std.str.each_word pub fn each_word(s: str, f: fn(str) -> ()) -> () — Walks the whitespace-separated words of s in order and calls f once per word, building nothing: the walk is the compiler's own lazy for-head over the receiver's bytes ([mem.str.view], s84), so each word is a zero-copy slice of s and no list exists. std.str.words_count pub fn words_count(s: str) -> int — The number of whitespace-separated words in s — words without the list OR the callback: the same fused walk as each_word, folded to a count. std.str.join pub fn join(sep: str, parts: List[str]) -> str — parts concatenated with the separator sep between consecutive items — the separator is the RECEIVER, as the sprint contract has it, which is why sep comes first. std.str.char_count pub fn char_count(s: str) -> int — The number of CODE POINTS in s — the count len deliberately does not give (§9: a function that counts code points says so in its name). std.str.char_offsets pub fn char_offsets(s: str) -> List[int] — The byte offset at which each code point of s STARTS, in order — the offset half of the blocked chars() (see the module header), and every offset in it is a boundary get will accept. std.str.code_points pub fn code_points(s: str) -> List[int] — The Unicode SCALAR VALUES of s's code points, in order, as ints. std.str.to_list_chars pub fn to_list_chars(s: str) -> List[char] — The code points of s as CHARS, in order — the sc03 contract's to_list_chars, code at last (sc24): a delegation to the language's s.chars() ([mem.str.chars], s120/s121), which yields the Unicode scalar values List[char]-typed under D58's ruling — a scalar value, ordered by scalar value, NOT an integer. std.str.is_ascii pub fn is_ascii(s: str) -> bool — Whether every code point in s is ASCII (below U+0080) — the cheap question a caller asks before treating byte offsets as character positions, and the one classification that needs no tables at all. std.str.to_strbuf pub fn to_strbuf(s: str) -> strbuf.StrBuf — s copied into a fresh std.strbuf.StrBuf — the allocating conversion into the builder (to_, §1: it allocates).