# unwrap()

## `Wrapper.unwrap()`

The method returns the given [`text`](#text-string) without the given [`opening`](#opening-string) and [`closing`](#closing-string) chars.

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

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

{% endcode %}

### Parameters

#### `text: string`

The **text** of the [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) from which given [`opening`](#opening-string) and [`closing`](#closing-string) chars are removed.

#### `opening: string`

The **opening** chars of the [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) to be removed in the given [`text`](#text-string).

#### `closing: string`

The **closing** chars of the [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) to be removed in the given [`text`](#text-string).

### Returns

The **return value** is the given [`text`](#text-string) of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type without the given [`opening`](#opening-string) and [`closing`](#closing-string) chars or unchanged [`text`](#text-string) if it does not contain the given [`opening`](#opening-string) and [`closing`](#closing-string) chars.

## Example usage

```typescript
// Example usage.
import { Wrapper } from '@angular-package/wrapper';

const quote = new Wrapper('[', ']', 'quote');

// Returns quote of string.
Wrapper.unwrap(quote.valueOf(), '[', ']');

// Returns [quote] of string.
Wrapper.unwrap(quote.valueOf(), '[[', ']]');
```


---

# 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/static/unwrap.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.
