lang.boolean
Module lang.boolean
ballerina/lang.boolean Ballerina library
Module overview
The lang.boolean
module corresponds to the boolean
basic type.
Functions
every
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
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
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
Import
import ballerina/lang.boolean;
Metadata
Released date: about 1 month ago
Version: 2201.8.6
Compatibility
Platform: java17
Ballerina version: 2201.8.6
GraalVM compatible: Yes