# textUnwrap()

## `Wrapper.prototype.textUnwrap()`

The method returns the [`text`](https://wrapper.angular-package.dev/wrap/accessors/text) of the [`Wrapper`](https://wrapper.angular-package.dev/wrapper) object without its [`opening`](https://wrapper.angular-package.dev/wrap/accessors/opening) and [`closing`](https://wrapper.angular-package.dev/wrap/accessors/closing) chars or the given [`opening`](#opening-string) and [`closing`](#closing-string) chars.

{% hint style="info" %}
The default values for the `opening` and `closing` parameters are taken from the `Wrapper` object.
{% endhint %}

{% code title="wrapper.class.ts" %}

```typescript
public textUnwrap(
  opening: string = this.opening,
  closing: string = this.closing
): string {
  return Wrapper.unwrap(this.text, opening, closing);
}
```

{% endcode %}

### Parameters

#### `opening: string`

Optional **opening** chars of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type to remove from the **beginning** of the [`text`](https://wrapper.angular-package.dev/wrap/accessors/text) of the [`Wrapper`](https://wrapper.angular-package.dev/wrapper) instance.

#### `closing: string`

Optional **closing** chars of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type to remove from the **end** of the [`text`](https://wrapper.angular-package.dev/wrap/accessors/text) of the [`Wrapper`](https://wrapper.angular-package.dev/wrapper) instance.

### Returns

The **return value** is the [`text`](https://wrapper.angular-package.dev/wrap/accessors/text) of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type without the [`opening`](https://wrapper.angular-package.dev/wrap/accessors/opening) and [`closing`](https://wrapper.angular-package.dev/wrap/accessors/closing) chars of the [`Wrapper`](https://wrapper.angular-package.dev/wrapper) object or given [`opening`](#opening-string) and [`closing`](#closing-string) chars.

## Example usage

```typescript
// 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.textUnwrap();

// Returns {This is a long text}.
longText.textUnwrap('', '');

// Returns This is a long text}.
longText.textUnwrap('{', '');

// Returns This is a long text.
longText.textUnwrap('{', undefined);

// Returns {This is a long text.
longText.textUnwrap('', '}');

// Returns This is a long text.
longText.textUnwrap(undefined, '}');
```
