Substitutes named variable references in a string.
Example:
substitute('{fruit}, {veg}', { fruit: 'apples', veg: 'carrots' }) // 'apples, carrots' Copy
substitute('{fruit}, {veg}', { fruit: 'apples', veg: 'carrots' }) // 'apples, carrots'
The template string.
A record of variable names to values.
A regex whose first capture group is the variable name. Defaults to {name}.
{name}
IllegalArgumentError if a referenced variable is not defined.
Substitutes named variable references in a string.
Example: