switch()

The switch() function compares an expression to different values, and return a result dependant on which value it equals to.

Syntax

switch(expr1, array1, array2, [expr2])
Note:
  1. If expr1 is in array1 at positionx, return value inside array2 at position x, if any.In other cases returnexpr2, if any.

Example

<div gwc:content="switch(number(i), [1, 2, 3, 4],
 ['this is one', 'this is two', 'this is three', 'this is four' ],
 'Don\'t know that number...')" />