new
pub fn new() str.String = trust { ... }Create empty string
fn alloc_in[T: allocators.Allocator](ac: T, size: i64) ref voidfn alloc_string_in[T: allocators.Allocator](ac: T, len: i64) str.Stringfn alloc_in_general[T: allocators.GeneralAllocator](ac: T, size: i64) ref voidfn alloc_string_in_general[T: allocators.GeneralAllocator](ac: T, len: i64) str.Stringpub fn new() str.String = trust { ... }Create empty string
pub fn from_cstr[T: allocators.Allocator](ac: T, cstr: ref u8) str.StringCreate from raw C string using the provided allocator.
pub fn free(s: str.String) void = trust { ... }Free string
pub fn len(s: str.String) i64Length of a str.String
pub fn as_cstr(s: str.String) ref u8 = trust { ... }Raw pointer
fn ensure_cap(ptr: ref void, needed: i64) void = trust { ... }Ensure capacity (private helper)
pub fn push_cstr(s: str.String, other: ref u8) void = trust { ... }Append a C string in place
pub fn push(s: str.String, other: str.String) void = trust { ... }Append another str.String in place
pub fn clone(s: str.String) str.String = trust { ... }Clone — returns a new heap-allocated str.String
pub fn reverse(s: str.String) void = trust { ... }Reverse in place
pub fn concat(a: str.String, b: str.String) str.String = trust { ... }Concat — returns a new heap-allocated str.String
pub fn reserve(s: str.String, cap: i64) void = trust { ... }Reserve at least cap bytes of capacity
pub fn clear(s: str.String) void = trust { ... }Clear contents (set length to 0, keep allocation)
pub fn push_char(s: str.String, c: u8) void = trust { ... }Append a single byte character
pub fn get(s: str.String, i: i64) option[u8]Get byte at index i, returns none if out of bounds
pub fn set(s: str.String, i: i64, c: u8) void = trust { ... }Set byte at index i (no-op if out of bounds)
pub fn slice(s: str.String, start: i64, end: i64) str.String = trust { ... }Return a new heap str.String containing bytes [start, end)
fn slice_general[T: allocators.GeneralAllocator](ac: T, s: str.String, start: i64, end: i64) str.Stringpub fn find(s: str.String, sub: str.String) option[i64]Find first occurrence of sub in s — returns some(index) or none
pub fn contains(s: str.String, sub: str.String) boolReturns true if sub appears anywhere in s
pub fn to_upper(s: str.String) void = trust { ... }Convert to uppercase in place
pub fn to_lower(s: str.String) void = trust { ... }Convert to lowercase in place
pub fn trim_left(s: str.String) void = trust { ... }Trim leading whitespace in place
pub fn trim_right(s: str.String) void = trust { ... }Trim trailing whitespace in place
pub fn trim(s: str.String) void = trust { ... }Trim leading and trailing whitespace in place
pub fn replace(s: str.String, from: str.String, to: str.String) str.String = trust { ... }Return a new str.String with all occurrences of from replaced by to
pub fn split[T: allocators.GeneralAllocator](ac: T, s: str.String, delim: str.String) result[ref void, ListAllocError]Split s by delim, returns an opaque list of Strings allocated with the provided general allocator.
pub fn equals(x: str.String, y: str.String) boolCheck if two strings are equal
pub fn trim_prefix(s: str.String, prefix: str.String) str.String = trust { ... }If s starts with prefix, return s without it, otherwise clone
pub fn trim_suffix(s: str.String, suffix: str.String) str.String = trust { ... }If s ends with suffix, return s without it, otherwise clone
pub fn starts_with(s: str.String, prefix: str.String) boolCheck if s starts with prefix
pub fn ends_with(s: str.String, suffix: str.String) boolCheck if s ends with suffix