Template:choose

From Wiktionary, the free dictionary
Jump to navigation Jump to search

This template returns only one among multiple unnamed parameters. It is, technically, a cleaner and stricter variety of {{#switch:}}.

Usage

Just fill multiple unnamed (positional) parameters with contents and input a number to the named parameter |choice=. If no number is input, "1" is assumed.

Examples

  • {{choose|cat|dog|mouse|choice=2}} returns:

dog

  • {{choose|cat|dog|mouse|choice=3}} returns:

mouse

  • {{choose|apple|pear|watermelon|banana|choice=1}} returns:

apple

  • {{choose|apple|pear|watermelon|banana}} returns:

apple

  • {{choose|apple|pear|watermelon|banana|choice=4}} returns:

banana

See also