tobool()
Convert inputs to boolean (signed 8-bit) representation.
The
tobool()
andtoboolean()
functions are equivalent
Note
When possible, use bool literals instead.
Syntax
tobool(
value)
Learn more about syntax conventions.
Parameters
Name | Type | Required | Description |
---|---|---|---|
value | string |
✔️ | The value to convert to boolean. |
Returns
If conversion is successful, result will be a boolean.
If conversion isn't successful, result will be null
.
Example
tobool("true") == true
tobool("false") == false
tobool(1) == true
tobool(123) == true
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for