WLJS LogoWLJS Notebook

TemplateSlot

TemplateSlot[n] represents a template slot to be filled from the nth argument when the template is applied.

TemplateSlot[name] represents a template slot to be filled from an element with key name in an association appearing in the first argument.

Examples

Create a template with numbered slots:

TemplateApply[StringTemplate["Hello, `1`!"], {"World"}]
(* "Hello, World!" *)

Use named slots:

TemplateApply[StringTemplate["Hello, `name`!"], <|"name" -> "Alice"|>]
(* "Hello, Alice!" *)

Please visit the official Wolfram Language Reference for more details.

On this page