Skip to main content Link Search Menu Expand Document (external link)

concat() : Concatenate Strings


On this page

Summary

Concatenate multiple strings into one.

Signature

concat(str1, str2, str3, ...)

Parameters

Parameter Type Required Description
str1, str2, ... String Yes Strings to concatenate (variable number)

Returns

Type: String

All input strings joined together.


Examples

Basic Concatenation


<!-- Output: Hello World -->

With Variables

<p></p>

Data:

doc.Params["model"] = new {
    firstName = "John",
    lastName = "Doe"
};

Output:

<p>John Doe</p>

Multiple Values


<!-- Output: Order #12345 - Shipped -->

With Formatting


<!-- Output: Total: $99.99 -->

In Log Statement



Notes

  • Null values are treated as empty strings
  • Non-string values are converted to strings
  • Empty strings are preserved
  • More efficient than multiple + operations for many strings

See Also