concatWs (Concatenate texts)

Prev Next

See also: split (Split separated text)

The function $concatWs() (concat with separator) converts all passed parameters (starting with the second digit) into a text and concatenates them separately from a specified separator/-text (separator).

Tooltip

Syntax: $concatWs(separator,a,b[,c[,...]])

Parameter

Description

separator

The separator character used to separate the concatenated text parts.

all other parameters

All parameters, starting from the second position, are converted into a text and concatenated separately from the defined separator/text.

Returns the parameters separated by the separator as concatenated text.

Example: $concatWs( ,This,is,a,concatenated,text) – returns 'This is a concatenated text'

Syntax

$concatWs(separator,a,b[,c[,...]])

Parameter

Name

Description

separator

The separator character used to separate the concatenated text parts.

all other parameters

All parameters, starting from the second position, are converted into a text and concatenated separately from the defined separator/text.

Return value

The parameters separated by the separator as concatenated text.

Example

Syntax

Result

Remarks

$concatWs(\n,This,is,a,concatenated,text)

This is a concatenated text.

The separator character '\n' represents a line break.

$concatWs(,This,is,a,concatenated,text)

This is a concatenated text

$concatWs( \, ,a,b,c,d,e)

a, b, c, d, e

Since the comma separates the parameters, it must be escaped from the evaluation.This is done with a prefixed '\' (backslash).