Cicode Programming Reference > Cicode Function Categories > String Functions > StrToBool

StrToBool

Converts a string value to a Boolean value.

Syntax

StrToBool(sVal)

sVal:

Boolean value as a string. Allowable values are: TRUE, FALSE or any numeric value.

Return Value

Boolean value of 0 or 1.

Example

StrToBool("TRUE"); // returns 1 which is TRUE
StrToBool("false"); // returns 0 which is FALSE
StrToBool("5"); // returns 1
StrToBool("Orange"); // returns 0
StrToBool("0"); // returns 0

See Also

String Functions, Using the Caret Escape Sequence Character

Published June 2018