> For the complete documentation index, see [llms.txt](https://wrapper.angular-package.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wrapper.angular-package.dev/wrapper/methods/instance/textunwrap.md).

# textUnwrap()

## `Wrapper.prototype.textUnwrap()`

The method returns the [`text`](/wrap/accessors/text.md) of the [`Wrapper`](/wrapper/overview.md) object without its [`opening`](/wrap/accessors/opening.md) and [`closing`](/wrap/accessors/closing.md) 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`](/wrap/accessors/text.md) of the [`Wrapper`](/wrapper/overview.md) 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`](/wrap/accessors/text.md) of the [`Wrapper`](/wrapper/overview.md) instance.

### Returns

The **return value** is the [`text`](/wrap/accessors/text.md) of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type without the [`opening`](/wrap/accessors/opening.md) and [`closing`](/wrap/accessors/closing.md) chars of the [`Wrapper`](/wrapper/overview.md) 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, '}');
```
