Expand description
Standard library functions for Sage.
This module provides runtime helper functions for the Sage standard library. Most stdlib functions are inlined during codegen, but some require runtime helpers for correct Unicode handling or complex logic.
Functions§
- parse_
bool - Parse a boolean from a string. Accepts “true”, “false”, “1”, “0” (case-insensitive for true/false).
- str_
index_ of - Find the index of a substring within a string (Unicode-aware). Returns None if not found, Some(index) otherwise.
- str_
pad_ end - Pad a string at the end to reach the target length (Unicode-aware).
- str_
pad_ start - Pad a string at the start to reach the target length (Unicode-aware).
- str_
slice - Extract a substring by character indices (Unicode-aware). Indices are inclusive start, exclusive end.