translate()

The translate() function translates a string.

Syntax

translate(expr1, expr2, expr3)
Note:
  1. Return string(expr1) with occurrences of string in string(expr2) replaced by the string at the corresponding position instring(expr3). Use expression with square brackets [] to replace a list of strings. Use quotes to replace character by character.

Examples

To replace character by character:
<div gwc:attributes="class translate(style, ' -/\#.=+()[]', '____________')"/>
To replace each strings in the array expr2 by the string expr3:
<div gwc:attributes="class translate(style, ['\\r\\n','\\n','\\r'], '<br/>')"/>