method str.parse
Parses the whole text as T (integer, float or bool); no surrounding whitespace is accepted.
Example:
fn main() io {
let n: i32 = "42".parse<i32>()!
print("{n + 1}")
}Output
43
pub(api) fn parse<T>() -> T | ParseErrorSince. 1.0.0-beta
Returns
T
Errors
ParseError@error
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/text.oxl:603