yields a TemplateObject expression that represents a string template to be applied to arguments.


uses File[], URL[] or CloudObject[] as the source for the string template.


yields a TemplateObject with arguments, suitable for cloud deployment or other evaluation.

Details and Options


open allclose all

Basic Examples  (4)

Apply a string template with slots named a and b:

An equivalent form using TemplateApply:

The StringTemplate is not needed inside TemplateApply:

Apply a string template to positional arguments:

An equivalent form:

The expression inside <* ... *> is evaluated when the string template is applied:

Include a template slot as well as an expression in the template string:

Values from the association can be used in the template expression:

Rule delayed can be used to delay computations:

Expressions are spliced into the string using TextString:

Scope  (4)

File is fully supported:

Templates can be hosted in the Wolfram Cloud:

CloudObject can be directly used by TemplateApply:

The second argument of StringTemplate can be used to bound data to the template:

URL can be used to fetch templates:

Options  (2)

CombinerFunction  (1)

Specify a different way to combine parts of templates:

It can be used to return any expression, not only a string:

InsertionFunction  (1)

Specify a function to convert arguments before they are inserted:

You can use a string to specify an export format:

Properties & Relations  (3)

StringTemplate evaluates to a TemplateObject:

If you deploy a template with data, each time you visit it TemplateApply will render the content again:

TemplateApply can be used to parse and apply a string template in one step:

Possible Issues  (1)

Data in the second argument of StringTemplate takes precedence over arguments in TemplateApply:

Neat Examples  (1)

You can deploy a StringTemplate to the cloud. When you visit the URL, TemplateApply will render the template on each visit:

Wolfram Research (2014), StringTemplate, Wolfram Language function,


Wolfram Research (2014), StringTemplate, Wolfram Language function,


@misc{reference.wolfram_2020_stringtemplate, author="Wolfram Research", title="{StringTemplate}", year="2014", howpublished="\url{}", note=[Accessed: 27-February-2021 ]}


@online{reference.wolfram_2020_stringtemplate, organization={Wolfram Research}, title={StringTemplate}, year={2014}, url={}, note=[Accessed: 27-February-2021 ]}


Wolfram Language. 2014. "StringTemplate." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (2014). StringTemplate. Wolfram Language & System Documentation Center. Retrieved from