Module
Module documentation.
modulestrconv
@briefString conversions
@detailsProvides helper functions to convert between String and Int/Float/Bool.
@see
- index.html
Classes
Classes and inheritance.
Functions
Free functions and class methods.
functionstrconv::__itoa_fast
Signature
extern func __itoa_fast(x: Int) -> String;extern func __itoa_fast(x: Int) -> String;
/*
@brief Binds the low-level runtime symbol `__utoa64_fast`.@briefBinds the low-level runtime symbol `__itoa_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
- xInput value.
@returnReturns the operation result as `String`.
functionstrconv::__utoa64_fast
Signature
extern func __utoa64_fast(x: UInt64) -> String;extern func __utoa64_fast(x: UInt64) -> String;
/*
@brief Binds the low-level runtime symbol `__atou64_fast`.@briefBinds the low-level runtime symbol `__utoa64_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
- xInput value.
@returnReturns the operation result as `String`.
functionstrconv::__atou64_fast
Signature
extern func __atou64_fast(s: String) -> UInt64;extern func __atou64_fast(s: String) -> UInt64;
/*
@brief Binds the low-level runtime symbol `__atof`.@briefBinds the low-level runtime symbol `__atou64_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 `UInt64`.
functionstrconv::__atof
Signature
extern func __atof(s: String) -> Float;extern func __atof(s: String) -> Float;
/*
@brief Binds the low-level runtime symbol `__ftoa`.@briefBinds the low-level runtime symbol `__atof`.
@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 `Float`.
functionstrconv::__ftoa
Signature
extern func __ftoa(x: Float) -> String;extern func __ftoa(x: Float) -> String;
/*
@brief Binds the low-level runtime symbol `__atof64`.@briefBinds the low-level runtime symbol `__ftoa`.
@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
- xInput value.
@returnReturns the operation result as `String`.
functionstrconv::__atof64
Signature
extern func __atof64(s: String) -> Float64;extern func __atof64(s: String) -> Float64;
/*
@brief Binds the low-level runtime symbol `__ftoa64`.@briefBinds the low-level runtime symbol `__atof64`.
@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 `Float64`.
functionstrconv::__ftoa64
Signature
extern func __ftoa64(x: Float64) -> String;extern func __ftoa64(x: Float64) -> String;
/*@briefBinds the low-level runtime symbol `__ftoa64`.
@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
- xInput value.
@returnReturns the operation result as `String`.
functionstrconv::atoi
Signature
func atoi(s: String) -> Intfunc atoi(s: String) -> Int {
let n: Int = std.len(s);
let i: Int = 0;@briefConvert string to integer
@param
- sInput string
@returnParsed integer
functionstrconv::itoa
Signature
func itoa(x: Int) -> Stringfunc itoa(x: Int) -> String {
return __itoa_fast(x);
}@briefConvert integer to decimal string
@param
- xInput integer
@returnDecimal string
functionstrconv::parse_uint64
Signature
func parse_uint64(s: String) -> UInt64func parse_uint64(s: String) -> UInt64 {
return __atou64_fast(s);
}@briefParses input data with `parse_uint64`.
@detailsExecutes the `parse_uint64` 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 `UInt64`.
functionstrconv::format_uint64
Signature
func format_uint64(x: UInt64) -> Stringfunc format_uint64(x: UInt64) -> String {
return __utoa64_fast(x);
}@briefProvides the system library operation `format_uint64`.
@detailsExecutes the `format_uint64` 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
- xInput value.
@returnReturns the operation result as `String`.
functionstrconv::parse_float
Signature
func parse_float(s: String) -> Floatfunc parse_float(s: String) -> Float {
return __atof(s);
}@briefConvert string to float
@detailsCalls std.atof(s).
@param
- sInput string
@returnFloat result
functionstrconv::parse_float64
Signature
func parse_float64(s: String) -> Float64func parse_float64(s: String) -> Float64 {
return __atof64(s);
}@briefConvert string to Float64
@detailsCalls the runtime double parser and preserves the language-level Float64 API shape.
@param
- sInput string
@returnFloat64 result
functionstrconv::format_float
Signature
func format_float(x: Float) -> Stringfunc format_float(x: Float) -> String {
return __ftoa(x);
}@briefConvert float to string
@detailsCalls std.ftoa(x).
@param
- xInput float
@returnString representation
functionstrconv::format_float64
Signature
func format_float64(x: Float64) -> Stringfunc format_float64(x: Float64) -> String {
return __ftoa64(x);
}@briefConvert Float64 to string
@detailsCalls the runtime double formatter without narrowing to Float first.
@param
- xInput Float64
@returnString representation
functionstrconv::parse_bool
Signature
func parse_bool(s: String) -> Boolfunc parse_bool(s: String) -> Bool {
let t: String = strings.to_lower_ascii(strings.trim(s));
if t == "1" || t == "t" || t == "true" {@briefConvert string to bool
@param
- sInput string
@returnBool result
functionstrconv::format_bool
Signature
func format_bool(b: Bool) -> Stringfunc format_bool(b: Bool) -> String {
if b {
return "true";@briefConvert bool to string
@detailstrue -> "true", false -> "false".
@param
- bInput bool
@returnString representation
Variables
Class fields (var).