textReplaceOpening()
Wrapper.prototype.textReplaceOpening()
Wrapper.prototype.textReplaceOpening()
Replaces the opening
chars of the Wrapper
object in the text
of the Wrapper
object with the given opening
chars.
public textReplaceOpening(opening: string): string {
return Wrapper.replaceOpening(this.text, this.opening, opening);
}
Parameters
opening: string
opening: string
The opening chars of string
to replace in the text
(part of the primitive value).
Returns
The return value is the text
of string
type with replaced opening
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.textReplaceOpening('');
// Returns {{This is a long text}.
longText.textReplaceOpening('{{');
Last updated
Was this helpful?