concat
Joins the value and every part into one string, in order, with no separator.
Concatenation is inherently textual, so the value and each part may be a scalar (a number or bool) and are taken as their string form; a composite value or part (a slice or map) is an error.
InputArgumentsReturns
Sourceany...anystringBasicSource
Joins the value and every part into one string, in order, with no separator.
Given
{"name": "report"}Template
{{ name | concat:'-','01','.txt' }}Result
report-01.txtNo partsSource
Returns the value unchanged when no parts are given.
Given
{"word": "solo"}Template
{{ word | concat }}Result
soloNumber partSource
Accepts a number part and appends its string form.
Given
{"base": "logs"}Template
{{ base | concat:'/',2024 }}Result
logs/2024Scalar valueSource
Takes a number value as its string form, so it can start a joined string.
Given
{"id": 42}Template
{{ id | concat:'-draft' }}Result
42-draft