Replace a placeholder in a template with content, safe against String.replace
special replacement patterns ($&, $`, $', $1…) that would otherwise be
interpreted when the content contains a $.
Parameters
template: string
The template string.
placeholder: string
The placeholder to replace (first occurrence).
content: string
The literal content to insert.
Returns string
The template with the placeholder replaced literally.
Replace a placeholder in a template with content, safe against
String.replacespecial replacement patterns ($&,$`,$',$1…) that would otherwise be interpreted when the content contains a$.