parseInt (Function)

Signature: parseInt(s: string) -> Result<int, Error>

Description: Strict base-10 signed-int parser. No whitespace tolerance.

Parameters

  • s (string): The string to parse

Returns: Result<int, Error>

Example

parseInt("42")  // Success { value: 42 }
parseInt "42"  // Success { value: 42 }