Functions

fromString
I

Converts a string to a boolean.

fromString

function fromString(string s) returns boolean | error
Isolated Function

Converts a string to a boolean.

Returns the boolean of which parameter s is a string representation. The accepted representations are true, false (in any combination of lower- and upper-case), and also 1 for true and 0 for false. This is the inverse of function value:toString applied to a boolean.

Parameters

  • s string
  • string representing a boolean value

Return Type

(boolean | error)

boolean that parameter s represents, or an error if there is no such boolean