Ballerina library
lang.boolean
Module lang.boolean
Definitions
ballerina/lang.boolean Ballerina library
2201.10.2
Module overview
The lang.boolean
module corresponds to the boolean
basic type.
Functions
every
Isolated Function
Returns true if all of its arguments are true and false otherwise. In particular, it returns true if there are no arguments.
boolean:every(true, false) ⇒ false boolean:every(true, true) ⇒ true boolean:every() ⇒ true
Parameters
- bs boolean... - boolean values to be evaluated
Return Type
- boolean - true if all of its arguments are true and false otherwise
fromString
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
.
boolean:fromString("true") ⇒ true boolean:fromString("0") ⇒ false boolean:fromString("01") ⇒ error
Parameters
- s string - string representing a boolean value
some
Isolated Function
Returns true if one or more of its arguments are true and false otherwise. In particular, it returns false if there are no arguments.
boolean:some(true, false) ⇒ true boolean:some(false, false) ⇒ false boolean:some() ⇒ false
Parameters
- bs boolean... - boolean values to be evaluated
Return Type
- boolean - true if one or more of its arguments are true and false otherwise