Texts with dynamic values

Syntax

	$input.fill($value1,..., $valueN)

Description

Dynamic values can be embedded in a text. The syntax for this is defined via the Java message format. If a text contains such placeholders ({0}, {1},...), these can be assigned using the function fill(...).

Parameters

name Type Type Description Mandatory Default
input String or internationalized text A text with at least one parameter that can be filled dynamically. yes
values Number/string/object Dynamic values for the placeholders to be replaced. yes

Return value

Type: String or internationalized text (depending on the type of input)

Text with inserted parameters.

Example with internationalized text

#("Die Antwort lautet {0}."@de, "{0} is the answer."@en).fill(42)

Output German: "Die Antwort lautet 42."

Output English: "42 is the answer."

Example with simple character string

"{0} is the answer.".fill(42)

Output: "42 is the answer.

If many texts are to be generated with the same pattern, the variant with message format is more efficient.