WLJS LogoWLJS Notebook

TemplateApply

TemplateApply[template] applies a template, evaluating all template elements it contains.

TemplateApply[template, args] applies a template, using args to fill slots in the template.

Examples

Apply a string template:

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

With named arguments:

TemplateApply[StringTemplate["The `item` costs `price`."], 
  <|"item" -> "book", "price" -> "$10"|>]
(* "The book costs $10." *)

Please visit the official Wolfram Language Reference for more details.

On this page