isTrue

Checks if a string or expression evaluates to TRUE.

Type and Usage

Parameters

The only parameter is the string or expression to be evaluated.

Output

If the parameter is a string:

  • Returns TRUE if the string begins with T, t, Y, y, or is 1.

  • Returns FALSE if the string begins with any other character.

If the parameter is not a string:

  • Returns TRUE if the value is not 0.

  • Returns FALSE if the value is 0.

Example

Evaluates the string yes and returns TRUE (1):

<$isTrue("yes")$>

Evaluates that the integer five is greater than one and returns TRUE (1):

<$isTrue(5>1)$>

Evaluates the result of the equation as zero and returns FALSE (0):

<$isTrue(1-1)$>

Evaluates the string equality statement as true and returns TRUE (1):

<$isTrue(strEquals("abc","abc"))$> 

See Also