Skip to the content
Documentation

choose

No ratings yet

Summary

Returns one of the parameters (pinpointed by the input parameter).

Usage

input|choose( value1 [, value2 [, ... ] ] )

Parameters

Name Type Description Required
value1 any A variable/value of any kind. Yes.
value2 any Another variable/value of any kind. No.

Returns

One of the parameters.

Description

This operator returns one of the parameters. The input parameter must be an integer that pinpoints exactly which parameter that should be returned. If the input parameter is zero, the operator will return the first parameter. If the input parameter is one, the operator will return the second parameter, and so on. If the offset is wrong, the operator will return FALSE.

Examples

Example 1
{0|choose( 'apples', 'bananas', 'coconuts' )}

The following output will be produced: "apples".

Example 2
{2|choose( 'apples', 'bananas', 'coconuts' )}

The following output will be produced: "coconuts".

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.