> 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/unwraptext.md).

# unwrapText()

## `Wrapper.prototype.unwrapText()`

The method returns the [primitive value](/wrap/methods/instance/valueof.md) of a specified [`Wrapper`](/wrapper/overview.md) object with [`text`](/wrap/accessors/text.md) unwrapped from the [`opening`](/wrap/accessors/opening.md) and [`closing`](/wrap/accessors/closing.md) chars of the [`Wrapper`](/wrapper/overview.md) instance or given [`opening`](#opening-string) and [`closing`](#closing-string) chars.

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

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

{% endcode %}

### Parameters

#### `opening: string`

Optional opening chars of [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#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://www.typescriptlang.org/docs/handbook/basic-types.html#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 [primitive value](/wrap/methods/instance/valueof.md) of [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string) type with [`text`](/wrap/accessors/text.md) unwrapped from the [`opening`](/wrap/accessors/opening.md) and [`closing`](/wrap/accessors/closing.md) chars of the [`Wrapper`](/wrapper/overview.md) object or the 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.unwrapText();

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

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

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

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