ez.no / exponential / documentation / reference / template operators / variables / is_string
$input|is_string( test )
| Name | Type | Description | Required |
|---|---|---|---|
| test | any | Variable to be checked. | only if input is omitted |
True or false.
The is_string operator simply checks if the supplied input or parameter is a string or not. The operator returns true if the input or the first parameter is a string. Otherwise false is returned. If both input and a parameter are supplied, it is the parameter that will be evaluated.
{"My string"|is_string}
The example above returns true.
{let my_variable=256} {$my_variable|is_string} {/let}
The example above returns false.
{let my_variable=256 my_string="women"} {$my_variable|is_string($my_string)} {/let}
The example above returns true.
{let my_variable=256 my_string="women"} {$my_string|is_string($my_variable)} {/let}
The example above returns false.
log in or create a user account to comment.
Comments