Replaces the chars of the object in the of the object with the given chars.
The replacement succeeds if the closing characters exist at the end of the text.
wrapper.class.ts
public textReplaceClosing(closing: string): string {
return Wrapper.replaceClosing(this.text, this.closing, closing);
}
Parameters
closing: string
The closing chars of to replace in the (part of the primitive value).
Returns
The return value is the of type with replaced chars.
Example usage
// Example usage.
import { Wrapper } from '@angular-package/wrapper';
const longText = new Wrapper('{', '}', '{This is a long text}');
// Returns {{This is a long text}}.
longText.valueOf();
// Returns {This is a long text.
longText.textReplaceClosing('');
// Returns {This is a long text}}.
longText.textReplaceClosing('}}');