EgretDoc
Back to Home
Location:system/strings

Module

Module documentation.

modulestrings
@briefString utilities
@detailsProvides common string helpers such as search, case conversion, splitting, and joining.
@see
  • index.html

Classes

Classes and inheritance.

Functions

Free functions and class methods.

functionstrings::__find_substr_from_fast
Signatureextern func __find_substr_from_fast(s: String, pat: String, start: Int) -> Int;
extern func __find_substr_from_fast(s: String, pat: String, start: Int) -> Int;
/*
@brief Binds the low-level runtime symbol `__find_substr_ascii_case_from_fast`.
@briefBinds the low-level runtime symbol `__find_substr_from_fast`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • sInput string.
  • patPattern string used for matching keys, text, routes, or protocol fields.
  • startZero-based starting index, byte offset, or range boundary for the operation.
@returnReturns the operation result as `Int`.
functionstrings::__find_substr_ascii_case_from_fast
Signatureextern func __find_substr_ascii_case_from_fast(s: String, pat: String, start: Int) -> Int;
extern func __find_substr_ascii_case_from_fast(s: String, pat: String, start: Int) -> Int;
/*
@brief Binds the low-level runtime symbol `__strings_last_index_fast`.
@briefBinds the low-level runtime symbol `__find_substr_ascii_case_from_fast`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • sInput string.
  • patPattern string used for matching keys, text, routes, or protocol fields.
  • startZero-based starting index, byte offset, or range boundary for the operation.
@returnReturns the operation result as `Int`.
functionstrings::__strings_last_index_fast
Signatureextern func __strings_last_index_fast(s: String, pat: String) -> Int;
extern func __strings_last_index_fast(s: String, pat: String) -> Int;
/*
@brief Binds the low-level runtime symbol `__strings_count_fast`.
@briefBinds the low-level runtime symbol `__strings_last_index_fast`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • sInput string.
  • patPattern string used for matching keys, text, routes, or protocol fields.
@returnReturns the operation result as `Int`.
functionstrings::__strings_count_fast
Signatureextern func __strings_count_fast(s: String, pat: String) -> Int;
extern func __strings_count_fast(s: String, pat: String) -> Int;
/*
@brief Binds the low-level runtime symbol `__strings_to_lower_ascii_fast`.
@briefBinds the low-level runtime symbol `__strings_count_fast`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • sInput string.
  • patPattern string used for matching keys, text, routes, or protocol fields.
@returnReturns the operation result as `Int`.
functionstrings::__strings_to_lower_ascii_fast
Signatureextern func __strings_to_lower_ascii_fast(s: String) -> String;
extern func __strings_to_lower_ascii_fast(s: String) -> String;
/*
@brief Binds the low-level runtime symbol `__strings_to_upper_ascii_fast`.
@briefBinds the low-level runtime symbol `__strings_to_lower_ascii_fast`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • sInput string.
@returnReturns the operation result as `String`.
functionstrings::__strings_to_upper_ascii_fast
Signatureextern func __strings_to_upper_ascii_fast(s: String) -> String;
extern func __strings_to_upper_ascii_fast(s: String) -> String;
/*
@brief Binds the low-level runtime symbol `__strings_replace_fast`.
@briefBinds the low-level runtime symbol `__strings_to_upper_ascii_fast`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • sInput string.
@returnReturns the operation result as `String`.
functionstrings::__strings_replace_fast
Signatureextern func __strings_replace_fast(s: String, pat: String, repl: String, max_count: Int) -> String;
extern func __strings_replace_fast(s: String, pat: String, repl: String, max_count: Int) -> String;
/*
@brief Binds the low-level runtime symbol `__strings_trim_ascii_fast`.
@briefBinds the low-level runtime symbol `__strings_replace_fast`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • sInput string.
  • patPattern string used for matching keys, text, routes, or protocol fields.
  • replReplacement text inserted when a match or placeholder is found.
  • max_countMaximum allowed count or byte size.
@returnReturns the operation result as `String`.
functionstrings::__strings_trim_ascii_fast
Signatureextern func __strings_trim_ascii_fast(s: String, mode: Int) -> String;
extern func __strings_trim_ascii_fast(s: String, mode: Int) -> String;

/*
@briefBinds the low-level runtime symbol `__strings_trim_ascii_fast`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • sInput string.
  • modeMode value that selects permissions, behavior, or formatting rules for the operation.
@returnReturns the operation result as `String`.
functionstrings::contains
Signaturefunc contains(s: String, sub: String) -> Bool
func contains(s: String, sub: String) -> Bool {
    return find_substr(s, sub) >= 0;
}
@briefCheck whether a substring exists
@detailsReturns true if sub appears anywhere in s.
@param
  • sSource string
  • subSubstring to search for
@returnWhether s contains sub
functionstrings::index
Signaturefunc index(s: String, sub: String) -> Int
func index(s: String, sub: String) -> Int {
    return find_substr(s, sub);
}
@briefFind the first occurrence of a substring
@detailsReturns the start index of the first occurrence of sub in s.
@param
  • sSource string
  • subSubstring to search for
@returnStart index.
functionstrings::index_from
Signaturefunc index_from(s: String, sub: String, start: Int) -> Int
func index_from(s: String, sub: String, start: Int) -> Int {
    return find_substr_from(s, sub, start);
}
@briefProvides the system library operation `index_from`.
@detailsExecutes the `index_from` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • subSubstring, submatch, or subcommand value selected by the operation.
  • startZero-based starting index, byte offset, or range boundary for the operation.
@returnReturns the operation result as `Int`.
functionstrings::find_substr_from
Signaturefunc find_substr_from(s: String, pat: String, start: Int) -> Int
func find_substr_from(s: String, pat: String, start: Int) -> Int {
    return __find_substr_from_fast(s, pat, start);
}
@briefFinds a matching position or element with `find_substr_from`.
@detailsExecutes the `find_substr_from` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • patPattern string used for matching keys, text, routes, or protocol fields.
  • startZero-based starting index, byte offset, or range boundary for the operation.
@returnReturns the operation result as `Int`.
functionstrings::find_substr
Signaturefunc find_substr(s: String, pat: String) -> Int
func find_substr(s: String, pat: String) -> Int {
    return find_substr_from(s, pat, 0);
}
@briefFinds a matching position or element with `find_substr`.
@detailsExecutes the `find_substr` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • patPattern string used for matching keys, text, routes, or protocol fields.
@returnReturns the operation result as `Int`.
functionstrings::find_substr_ascii_case_from
Signaturefunc find_substr_ascii_case_from(s: String, pat: String, start: Int) -> Int
func find_substr_ascii_case_from(s: String, pat: String, start: Int) -> Int {
    return __find_substr_ascii_case_from_fast(s, pat, start);
}
@briefFinds a matching position or element with `find_substr_ascii_case_from`.
@detailsExecutes the `find_substr_ascii_case_from` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • patPattern string used for matching keys, text, routes, or protocol fields.
  • startZero-based starting index, byte offset, or range boundary for the operation.
@returnReturns the operation result as `Int`.
functionstrings::find_substr_ascii_case
Signaturefunc find_substr_ascii_case(s: String, pat: String) -> Int
func find_substr_ascii_case(s: String, pat: String) -> Int {
    return find_substr_ascii_case_from(s, pat, 0);
}
@briefFinds a matching position or element with `find_substr_ascii_case`.
@detailsExecutes the `find_substr_ascii_case` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • patPattern string used for matching keys, text, routes, or protocol fields.
@returnReturns the operation result as `Int`.
functionstrings::contains_ascii_case
Signaturefunc contains_ascii_case(s: String, sub: String) -> Bool
func contains_ascii_case(s: String, sub: String) -> Bool {
    return find_substr_ascii_case(s, sub) >= 0;
}
@briefProvides the system library operation `contains_ascii_case`.
@detailsExecutes the `contains_ascii_case` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • subSubstring, submatch, or subcommand value selected by the operation.
@returnReturns a boolean result; true means the condition holds or the operation succeeded.
functionstrings::equal_fold_ascii
Signaturefunc equal_fold_ascii(a: String, b: String) -> Bool
func equal_fold_ascii(a: String, b: String) -> Bool {
    if std.len(a) != std.len(b) {
        return false;
@briefProvides the system library operation `equal_fold_ascii`.
@detailsExecutes the `equal_fold_ascii` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • aInput value used for comparison, computation, or conversion.
  • bInput value used for comparison, computation, or conversion.
@returnReturns a boolean result; true means the condition holds or the operation succeeded.
functionstrings::count
Signaturefunc count(s: String, sub: String) -> Int
func count(s: String, sub: String) -> Int {
    return __strings_count_fast(s, sub);
}
@briefProvides the system library operation `count`.
@detailsExecutes the `count` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • subSubstring, submatch, or subcommand value selected by the operation.
@returnReturns the operation result as `Int`.
functionstrings::last_index
Signaturefunc last_index(s: String, sub: String) -> Int
func last_index(s: String, sub: String) -> Int {
    return __strings_last_index_fast(s, sub);
}
@briefFind the last occurrence of a substring
@param
  • sSource string
  • subSubstring to search for
@returnStart index.
functionstrings::trim_space
Signaturefunc trim_space(s: String) -> String
func trim_space(s: String) -> String {
    return trim(s);
}
@briefTrim leading and trailing whitespace
@detailsCalls strings.trim(s) to remove leading/trailing whitespace (as defined by strings.is_space).
@param
  • sInput string
@returnTrimmed string
functionstrings::is_ascii_space_byte
Signaturefunc is_ascii_space_byte(ch: Int) -> Bool
func is_ascii_space_byte(ch: Int) -> Bool {
    return ch == 32 || ch == 9 || ch == 10 || ch == 13;
}
@briefTests whether the state satisfies the condition represented by `is_ascii_space_byte`.
@detailsExecutes the `is_ascii_space_byte` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • chCharacter code or channel handle processed by the operation.
@returnReturns a boolean result; true means the condition holds or the operation succeeded.
functionstrings::is_ascii_lower_byte
Signaturefunc is_ascii_lower_byte(ch: Int) -> Bool
func is_ascii_lower_byte(ch: Int) -> Bool {
    return ch >= 97 && ch <= 122;
}
@briefTests whether the state satisfies the condition represented by `is_ascii_lower_byte`.
@detailsExecutes the `is_ascii_lower_byte` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • chCharacter code or channel handle processed by the operation.
@returnReturns a boolean result; true means the condition holds or the operation succeeded.
functionstrings::is_ascii_upper_byte
Signaturefunc is_ascii_upper_byte(ch: Int) -> Bool
func is_ascii_upper_byte(ch: Int) -> Bool {
    return ch >= 65 && ch <= 90;
}
@briefTests whether the state satisfies the condition represented by `is_ascii_upper_byte`.
@detailsExecutes the `is_ascii_upper_byte` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • chCharacter code or channel handle processed by the operation.
@returnReturns a boolean result; true means the condition holds or the operation succeeded.
functionstrings::is_ascii_alpha_byte
Signaturefunc is_ascii_alpha_byte(ch: Int) -> Bool
func is_ascii_alpha_byte(ch: Int) -> Bool {
    return is_ascii_lower_byte(ch) || is_ascii_upper_byte(ch);
}
@briefTests whether the state satisfies the condition represented by `is_ascii_alpha_byte`.
@detailsExecutes the `is_ascii_alpha_byte` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • chCharacter code or channel handle processed by the operation.
@returnReturns a boolean result; true means the condition holds or the operation succeeded.
functionstrings::is_ascii_digit_byte
Signaturefunc is_ascii_digit_byte(ch: Int) -> Bool
func is_ascii_digit_byte(ch: Int) -> Bool {
    return ch >= 48 && ch <= 57;
}
@briefTests whether the state satisfies the condition represented by `is_ascii_digit_byte`.
@detailsExecutes the `is_ascii_digit_byte` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • chCharacter code or channel handle processed by the operation.
@returnReturns a boolean result; true means the condition holds or the operation succeeded.
functionstrings::is_ascii_alnum_byte
Signaturefunc is_ascii_alnum_byte(ch: Int) -> Bool
func is_ascii_alnum_byte(ch: Int) -> Bool {
    return is_ascii_alpha_byte(ch) || is_ascii_digit_byte(ch);
}
@briefTests whether the state satisfies the condition represented by `is_ascii_alnum_byte`.
@detailsExecutes the `is_ascii_alnum_byte` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • chCharacter code or channel handle processed by the operation.
@returnReturns a boolean result; true means the condition holds or the operation succeeded.
functionstrings::is_space
Signaturefunc is_space(ch: String) -> Bool
func is_space(ch: String) -> Bool {
    return std.len(ch) == 1 && is_ascii_space_byte(std.byte_at(ch, 0));
}
@briefTests whether the state satisfies the condition represented by `is_space`.
@detailsExecutes the `is_space` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • chCharacter code or channel handle processed by the operation.
@returnReturns a boolean result; true means the condition holds or the operation succeeded.
functionstrings::trim_left
Signaturefunc trim_left(s: String) -> String
func trim_left(s: String) -> String {
    return __strings_trim_ascii_fast(s, 1);
}
@briefProvides the system library operation `trim_left`.
@detailsExecutes the `trim_left` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
@returnReturns the operation result as `String`.
functionstrings::trim_right
Signaturefunc trim_right(s: String) -> String
func trim_right(s: String) -> String {
    return __strings_trim_ascii_fast(s, 2);
}
@briefProvides the system library operation `trim_right`.
@detailsExecutes the `trim_right` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
@returnReturns the operation result as `String`.
functionstrings::trim
Signaturefunc trim(s: String) -> String
func trim(s: String) -> String {
    return __strings_trim_ascii_fast(s, 0);
}
@briefProvides the system library operation `trim`.
@detailsExecutes the `trim` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
@returnReturns the operation result as `String`.
functionstrings::trim_prefix
Signaturefunc trim_prefix(s: String, prefix: String) -> String
func trim_prefix(s: String, prefix: String) -> String {
    if starts_with(s, prefix) {
        return std.substr(s, std.len(prefix), std.len(s) - std.len(prefix));
@briefProvides the system library operation `trim_prefix`.
@detailsExecutes the `trim_prefix` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • prefixPrefix string matched, added, stripped, or used to build keys and paths.
@returnReturns the operation result as `String`.
functionstrings::trim_suffix
Signaturefunc trim_suffix(s: String, suffix: String) -> String
func trim_suffix(s: String, suffix: String) -> String {
    if ends_with(s, suffix) {
        return std.substr(s, 0, std.len(s) - std.len(suffix));
@briefProvides the system library operation `trim_suffix`.
@detailsExecutes the `trim_suffix` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • suffixSuffix string matched, appended, or removed by the operation.
@returnReturns the operation result as `String`.
functionstrings::strip_prefix
Signaturefunc strip_prefix(s: String, prefix: String) -> String
func strip_prefix(s: String, prefix: String) -> String {
    return trim_prefix(s, prefix);
}
@briefProvides the system library operation `strip_prefix`.
@detailsExecutes the `strip_prefix` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • prefixPrefix string matched, added, stripped, or used to build keys and paths.
@returnReturns the operation result as `String`.
functionstrings::strip_suffix
Signaturefunc strip_suffix(s: String, suffix: String) -> String
func strip_suffix(s: String, suffix: String) -> String {
    return trim_suffix(s, suffix);
}
@briefProvides the system library operation `strip_suffix`.
@detailsExecutes the `strip_suffix` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • suffixSuffix string matched, appended, or removed by the operation.
@returnReturns the operation result as `String`.
functionstrings::to_lower
Signaturefunc to_lower(s: String) -> String
func to_lower(s: String) -> String {
    return to_lower_ascii(s);
}
@briefASCII lowercasing
@detailsConverts A-Z to a-z in s (does not handle Unicode).
@param
  • sInput string
@returnLowercased string
functionstrings::to_upper
Signaturefunc to_upper(s: String) -> String
func to_upper(s: String) -> String {
    return to_upper_ascii(s);
}
@briefASCII uppercasing
@detailsConverts a-z to A-Z in s (does not handle Unicode).
@param
  • sInput string
@returnUppercased string
functionstrings::lower_ascii_char
Signaturefunc lower_ascii_char(ch: String) -> String
func lower_ascii_char(ch: String) -> String {
    if std.len(ch) != 1 {
        return ch;
@briefProvides the system library operation `lower_ascii_char`.
@detailsExecutes the `lower_ascii_char` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • chCharacter code or channel handle processed by the operation.
@returnReturns the operation result as `String`.
functionstrings::upper_ascii_char
Signaturefunc upper_ascii_char(ch: String) -> String
func upper_ascii_char(ch: String) -> String {
    if std.len(ch) != 1 {
        return ch;
@briefProvides the system library operation `upper_ascii_char`.
@detailsExecutes the `upper_ascii_char` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • chCharacter code or channel handle processed by the operation.
@returnReturns the operation result as `String`.
functionstrings::to_lower_ascii
Signaturefunc to_lower_ascii(s: String) -> String
func to_lower_ascii(s: String) -> String {
    return __strings_to_lower_ascii_fast(s);
}
@briefConverts to the target representation with `to_lower_ascii`.
@detailsExecutes the `to_lower_ascii` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
@returnReturns the operation result as `String`.
functionstrings::to_upper_ascii
Signaturefunc to_upper_ascii(s: String) -> String
func to_upper_ascii(s: String) -> String {
    return __strings_to_upper_ascii_fast(s);
}
@briefConverts to the target representation with `to_upper_ascii`.
@detailsExecutes the `to_upper_ascii` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
@returnReturns the operation result as `String`.
functionstrings::starts_with
Signaturefunc starts_with(s: String, prefix: String) -> Bool
func starts_with(s: String, prefix: String) -> Bool {
    return std.view(s).starts_with(std.view(prefix));
}
@briefProvides the system library operation `starts_with`.
@detailsExecutes the `starts_with` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • prefixPrefix string matched, added, stripped, or used to build keys and paths.
@returnReturns a boolean result; true means the condition holds or the operation succeeded.
functionstrings::repeat
Signaturefunc repeat(s: String, n: Int) -> String
func repeat(s: String, n: Int) -> String {
    if n <= 0 {
        return "";
@briefProvides the system library operation `repeat`.
@detailsExecutes the `repeat` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • nCount, size, or limit value.
@returnReturns the operation result as `String`.
functionstrings::ends_with
Signaturefunc ends_with(s: String, suffix: String) -> Bool
func ends_with(s: String, suffix: String) -> Bool {
    return std.view(s).ends_with(std.view(suffix));
}
@briefProvides the system library operation `ends_with`.
@detailsExecutes the `ends_with` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • suffixSuffix string matched, appended, or removed by the operation.
@returnReturns a boolean result; true means the condition holds or the operation succeeded.
functionstrings::replace_n
Signaturefunc replace_n(s: String, pat: String, repl: String, max_count: Int) -> String
func replace_n(s: String, pat: String, repl: String, max_count: Int) -> String {
    return __strings_replace_fast(s, pat, repl, max_count);
}
@briefProvides the system library operation `replace_n`.
@detailsExecutes the `replace_n` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • patPattern string used for matching keys, text, routes, or protocol fields.
  • replReplacement text inserted when a match or placeholder is found.
  • max_countMaximum allowed count or byte size.
@returnReturns the operation result as `String`.
functionstrings::replace_all
Signaturefunc replace_all(s: String, pat: String, repl: String) -> String
func replace_all(s: String, pat: String, repl: String) -> String {
    return replace_n(s, pat, repl, -1);
}
@briefProvides the system library operation `replace_all`.
@detailsExecutes the `replace_all` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • patPattern string used for matching keys, text, routes, or protocol fields.
  • replReplacement text inserted when a match or placeholder is found.
@returnReturns the operation result as `String`.
functionstrings::replace_first
Signaturefunc replace_first(s: String, pat: String, repl: String) -> String
func replace_first(s: String, pat: String, repl: String) -> String {
    return replace_n(s, pat, repl, 1);
}
@briefProvides the system library operation `replace_first`.
@detailsExecutes the `replace_first` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • patPattern string used for matching keys, text, routes, or protocol fields.
  • replReplacement text inserted when a match or placeholder is found.
@returnReturns the operation result as `String`.
functionstrings::parse_hex_int
Signaturefunc parse_hex_int(s: String) -> Int
func parse_hex_int(s: String) -> Int {
    let t: String = trim_space(s);
    let n: Int = std.len(t);
@briefParse a hexadecimal integer prefix
@param
  • sInput string
@returnParsed integer value, or 0 if no hexadecimal digit is present
functionstrings::split_ranges
Signaturefunc split_ranges(s: String, sep: String, out: collections.Vector<Int>) -> Int
func split_ranges(s: String, sep: String, out: collections.Vector<Int>) -> Int {
    let n: Int = std.len(s);
    let m: Int = std.len(sep);
@briefSplit by delimiter and output ranges
@param
  • sInput string
  • sepDelimiter string
  • outOutput ranges (appended.
@returnNumber of segments (returned by strings.split_ranges)
@see
  • strings.split_ranges
functionstrings::join_ranges
Signaturefunc join_ranges(src: String, ranges: collections.Vector<Int>, sep: String) -> String
func join_ranges(src: String, ranges: collections.Vector<Int>, sep: String) -> String {
    let bld: std.StringBuilder = new std.StringBuilder(std.len(src) + ranges.len() * std.len(sep));
    let first: Bool = true;
@briefJoin string slices by ranges
@param
  • srcSource string
  • rangesRange array (start/end pairs)
  • sepSeparator string
@returnJoined string
functionstrings::split
Signaturefunc split(s: String, sep: String) -> collections.Vector<String>
func split(s: String, sep: String) -> collections.Vector<String> {
    let out: collections.Vector<String> = new collections.Vector<String>();
    let n: Int = std.len(s);
@briefProvides the system library operation `split`.
@detailsExecutes the `split` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • sepSeparator string used when splitting or joining text.
@returnReturns the operation result as `collections.Vector<String>`.
functionstrings::fields
Signaturefunc fields(s: String) -> collections.Vector<String>
func fields(s: String) -> collections.Vector<String> {
    let out: collections.Vector<String> = new collections.Vector<String>();
    let sv: std.StringView = std.view(s);
@briefProvides the system library operation `fields`.
@detailsExecutes the `fields` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
@returnReturns the operation result as `collections.Vector<String>`.
functionstrings::join_parts
Signaturefunc join_parts(parts: collections.Vector<String>, sep: String) -> String
func join_parts(parts: collections.Vector<String>, sep: String) -> String {
    if parts.len() == 0 {
        return "";
@briefProvides the system library operation `join_parts`.
@detailsExecutes the `join_parts` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • partsOrdered collection of string or protocol fragments joined, encoded, or inspected by the operation.
  • sepSeparator string used when splitting or joining text.
@returnReturns the operation result as `String`.

Variables

Class fields (var).