OxL Reference

method str.parse

Parses the whole text as T (integer, float or bool); no surrounding whitespace is accepted.

Example:

oxl✓ checked in CI
fn main() io {
  let n: i32 = "42".parse<i32>()!
  print("{n + 1}")
}
Output
43
pub(api) fn parse<T>() -> T | ParseError

Since. 1.0.0-beta

Returns

T

Errors

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/text.oxl:603

See also