Returns given without the and chars of the object.
wrapper.class.ts
public removeWrapIn(text: string): string {
return (
(text = this.replaceClosingIn(text, '')),
(text = this.replaceOpeningIn(text, '')),
text
);
}
Parameters
text: string
The text of a type to unwrap from the and chars of the object.
Returns
The return value is the text of type unwrapped from the and chars of the object.
Example usage
// Example usage.
import { Wrapper } from '@angular-package/wrapper';
const longText = new Wrapper('{{', '}}', 'This is a long text');
const text = `Lorem ipsum and more`;
// Returns Lorem ipsum and more.
longText.removeWrapIn(`${longText.opening}${text}${longText.closing}`);
// Returns }}Lorem ipsum and more{{.
longText.removeWrapIn(`${longText.closing}${text}${longText.opening}`);