11.6 concat()

The concat() function concatenates several strings into one string. During concatenation, a separator string can be inserted between the strings or the strings can be appended to each other repeatedly.

Definition

If the first parameter is a string, this string is always inserted between two strings to be concatenated.

string concat
(
      string   Separator input,
      anyvalue Value1    input
  { , anyvalue Value2    input
  ...
  { , anyvalue Value15   input } }
)

If the first parameter is an integer value, it defines how often the concatenation of the strings is repeated.

string concat
(
      integer  Repeat  input,
      anyvalue Value1  input
  { , anyvalue Value2  input
  ...
  { , anyvalue Value15 input } }
)

Parameters

string Separator input

This parameter contains a delimiter string that is inserted between two strings during concatenation.

Separator cannot be used together with Repeat.

integer Repeat input

This parameter defines how often the concatenation of the strings shall be repeated. First, a string is created from the passed Value parameters, then this string is appended to each other as often as specified in Repeat. If Repeat <= 0, an empty string is returned.

Repeat cannot be used together with Separator.

anyvalue Value1 input
anyvalue Value2 input

anyvalue Value15 input

In these (optional) parameters, the values that shall be concatenated to a string are passed.

Scalar values are converted to strings for concatenation. If the parameters contain collections, then first the values contained therein are concatenated (without default values) and then the parameters are concatenated to each other. The approach is the same as calling sprintf("%s", <Value>).

Return value

A string in which the passed values have been concatenated.

Examples