githubEdit

static unwrap()

Wrapper.unwrap()

The method returns the given text without the given opening and closing chars.

wrapper.class.ts
public static unwrap(text: string, opening = '', closing = ''): string {
  return (
    (text = this.replaceClosing(text, closing, '')),
    (text = this.replaceOpening(text, opening, '')),
    text
  );
}

Parameters

text: string

The text of the stringarrow-up-right from which given opening and closing chars are removed.

opening: string

The opening chars of the stringarrow-up-right to be removed in the given text.

closing: string

The closing chars of the stringarrow-up-right to be removed in the given text.

Returns

The return value is the given text of stringarrow-up-right type without the given opening and closing chars or unchanged text if it does not contain the given opening and closing chars.

Example usage

Last updated