★ replaceText()
Wrap.prototype.replaceText()
Wrap.prototype.replaceText()Returns the primitive value with replaced text.
public replaceText<ReplaceText extends string = ''>(
text: ReplaceText
): `${Opening}${ReplaceText}${Closing}` {
return `${this.#opening}${text}${this.#closing}`;
}Generic type variables
ReplaceTextextendsstring=''
ReplaceTextextendsstring=''A generic type variable constrained by the string, by default of the value captured from the provided text indicates the ReplaceText type on the template of the return type.
Parameters
text: ReplaceText
text: ReplaceTextThe text of a generic type variable ReplaceText to replace the text in the primitive value.
Return type
${Opening}${ReplaceText}${Closing}
${Opening}${ReplaceText}${Closing}The return type is the template literal of generic type variables in order Opening, ReplaceText and Closing.
Returns
The return value is the primitive value with replaced text of a generic type variables in order Opening, ReplaceText and Closing on the template.
Example usage
Last updated
Was this helpful?