# unwrapText()

## `Wrapper.prototype.unwrapText()`

The method returns the [primitive value](https://wrapper.angular-package.dev/wrap/methods/instance/valueof) of a specified [`Wrapper`](https://wrapper.angular-package.dev/wrapper) object with [`text`](https://wrapper.angular-package.dev/wrap/accessors/text) unwrapped from 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) 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`](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://www.typescriptlang.org/docs/handbook/basic-types.html#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 [primitive value](https://wrapper.angular-package.dev/wrap/methods/instance/valueof) of [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string) type with [`text`](https://wrapper.angular-package.dev/wrap/accessors/text) unwrapped from 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 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('{{', '}}');
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wrapper.angular-package.dev/wrapper/methods/instance/unwraptext.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
