> 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-draft/wrapper/overview.md).

# Overview

## Wrapper {}

The [`Wrapper`](https://github.com/angular-package/wrapper/blob/main/src/lib/wrapper.class.ts) is an extension of the [`Wrap`](/wrapper-draft/wrap/overview.md) object, which means it represents the [immutable](https://developer.mozilla.org/en-US/docs/Glossary/Immutable) wrap of the [opening](/wrapper-draft/getting-started/basic-concepts.md#opening) and [closing](/wrapper-draft/getting-started/basic-concepts.md#closing) with the additional main ability to use it to wrap strings.&#x20;

{% embed url="<https://github.com/angular-package/wrapper/blob/main/src/lib/wrapper.class.ts>" %}

## Instance

### Accessors

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><a href="/pages/dIt0LA2PkvJjanvPskVn#symbol.tostringtag"><strong>​\[Symbol.toStringTag]</strong></a><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag"><code>toStringTag</code></a> of the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol"><code>Symbol</code></a> changes the default tag <code>String</code> of the instance to the custom tag <code>Wrapper</code>.</p> |

### Methods

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>public <a href="/pages/d21qDnBfyU77dU1rfFqm"><strong>isClosingIn()</strong></a><br>Determines whether the provided <a href="/pages/d21qDnBfyU77dU1rfFqm#text-string"><code>text</code></a> has the <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars of the specified <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object at the <strong>end</strong>.</p>                                                                                                                                                                                                                                                                                                                                                        |
| <p>public <a href="/pages/IBwPUqKOAFDqfubAkCGH"><strong>isOpeningIn()</strong></a><br>Checks whether the provided <a href="/pages/IBwPUqKOAFDqfubAkCGH#text-string"><code>text</code></a> has the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> chars of a specified <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object at the <strong>beginning</strong>.</p>                                                                                                                                                                                                                                                                                                                                                        |
| <p>public <a href="/pages/9YbldIwnBrRHuqRn3Ekr"><strong>replaceClosingIn()</strong></a><br>Replaces the <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars of the <a href="/pages/O5zJvtCr0bk2EDs7sRGG"><code>Wrapper</code></a> object in the given <a href="/pages/9YbldIwnBrRHuqRn3Ekr#text-string"><code>text</code></a> with a given <a href="/pages/9YbldIwnBrRHuqRn3Ekr#replacevalue-string">replacement value</a>.</p>                                                                                                                                                                                                                                                                                                          |
| <p>public <a href="/pages/r0ktt8Z6NQYoJvssaWgS#replacevalue-string"><strong>replaceOpeningIn()</strong></a><br>Replaces the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> chars of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object in the given <a href="/pages/r0ktt8Z6NQYoJvssaWgS#text-string"><code>text</code></a> with a given <a href="/pages/r0ktt8Z6NQYoJvssaWgS#replacevalue-string">replacement value</a>.</p>                                                                                                                                                                                                                                                                                      |
| <p>public <a href="/pages/WVpq8VTHOJozPS19D6NM"><strong>removeWrapIn()</strong></a><br>Returns given <a href="/pages/WVpq8VTHOJozPS19D6NM#text-string"><code>text</code></a> without the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object.</p>                                                                                                                                                                                                                                                                                                                                        |
| <p>public <a href="/pages/yJLLsLxEoVvdfSws5cFN"><strong>textReplaceClosing()</strong></a><br>Replaces the <a href="/pages/QTYxQh3MKwTJRj5pYA28#wrap.prototype.closing"><code>closing</code></a> chars of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object in the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object with the given <a href="/pages/yJLLsLxEoVvdfSws5cFN#closing-string"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                |
| <p>public <a href="/pages/N7aDbyfgseigOkMY27ej"><strong>textReplaceOpening()</strong></a><br>Replaces the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> chars of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object in the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object with the given <a href="/pages/N7aDbyfgseigOkMY27ej#opening-string"><code>opening</code></a> chars.</p>                                                                                                                                                                                                                                       |
| <p>public <a href="/pages/zP95dShqIpnoCQ6qbOps"><strong>textUnwrap()</strong></a><br>The method returns the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object without its <a href="/pages/QTYxQh3MKwTJRj5pYA28#wrap.prototype.opening"><code>opening</code></a> and <a href="/pages/QTYxQh3MKwTJRj5pYA28#wrap.prototype.closing"><code>closing</code></a> chars or the given <a href="#opening-string"><code>opening</code></a> and <a href="#closing-string"><code>closing</code></a> chars.</p>                                                                                                                                                                  |
| <p>public <a href="/pages/RieQNAg5fhTZm6EdBuIf"><strong>textWrap()</strong></a><br>The method returns the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object wrapped by the given <a href="/pages/RieQNAg5fhTZm6EdBuIf#opening-textopening"><code>opening</code></a> and <a href="/pages/RieQNAg5fhTZm6EdBuIf#closing-textclosing"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                                                                                              |
| <p>public <a href="/pages/0bfdKmmJzsCWEBghlZSH"><strong>toArray()</strong></a><br>Returns an <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array"><code>array</code></a> consisting of the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> chars, <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a>, and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                                                                                                   |
| <p>public <a href="/pages/DsvHxsxvwveQscLtP0ZI"><strong>toWrap()</strong></a><br>Returns the <a href="/pages/ynTr7YIdKgv6qw68JPND"><code>Wrap</code></a> instance consists of the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a>, <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object.</p>                                                                                                                                                                                                                                                                                  |
| <p>public <a href="/pages/J4YBGUI01fGt5Mk2oESt"><strong>unwrap()</strong></a><br>Returns the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> without the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| <p>public <a href="/pages/P82XvzmtBw8jttgtZaG3"><strong>unwrapText()</strong></a><br>The method returns the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of a specified <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object with <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> unwrapped from the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> instance or given <a href="/pages/P82XvzmtBw8jttgtZaG3#opening-string"><code>opening</code></a> and <a href="/pages/P82XvzmtBw8jttgtZaG3#closing-string"><code>closing</code></a> chars.</p> |
| <p>public <a href="/pages/bVYiVYIgClIeuiRUmLQi"><strong>★ wrap()</strong></a><br>The method wraps the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of a specified <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object by its <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars, or the given <a href="/pages/bVYiVYIgClIeuiRUmLQi#opening-customopening"><code>opening</code></a> and <a href="/pages/bVYiVYIgClIeuiRUmLQi#closing-customclosing"><code>closing</code></a> chars.</p>                                                                                                                                                |
| <p>public <a href="/pages/HA4KMgni3JQhmXjFbfIa"><strong>★ wrapOn()</strong></a><br>The method wraps the given <a href="/pages/HA4KMgni3JQhmXjFbfIa#text-customtext"><code>text</code></a> with the wrap, the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a>, and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars of the <a href="/pages/O5zJvtCr0bk2EDs7sRGG"><code>Wrapper</code></a> object.</p>                                                                                                                                                                                                                                                                                                                   |
| <p>public <a href="/pages/AO2JRfFReB5un4hz9RZ4"><strong>★ wrapText()</strong></a><br>The method returns the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object with <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> wrapped by given <a href="/pages/AO2JRfFReB5un4hz9RZ4#opening-textopening"><code>opening</code></a> and <a href="/pages/AO2JRfFReB5un4hz9RZ4#closing-textclosing"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                                 |

## public Static

### Methods

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>public static <a href="/pages/LdfMlqMjsIsAnp4HA2j4"><strong>define()</strong></a><br>Defines a new <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> instance with the provided <a href="/pages/LdfMlqMjsIsAnp4HA2j4#opening-opening"><code>opening</code></a>, <a href="/pages/LdfMlqMjsIsAnp4HA2j4#closing-closing"><code>closing</code></a> chars, and optional <a href="/pages/LdfMlqMjsIsAnp4HA2j4#text-text"><code>text</code></a>.</p>                                                                                                     |
| <p>public static <a href="/pages/qQhlZJ2CQYnZ1ZOU7zkD"><strong>isWrapper()</strong></a><br>The method checks if the <a href="/pages/qQhlZJ2CQYnZ1ZOU7zkD#value-any"><code>value</code></a> of any type is an instance of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> of any, or given <a href="/pages/qQhlZJ2CQYnZ1ZOU7zkD#opening-opening"><code>opening</code></a>, <a href="/pages/qQhlZJ2CQYnZ1ZOU7zkD#closing-closing"><code>closing</code></a> chars, and <a href="/pages/qQhlZJ2CQYnZ1ZOU7zkD#text-text"><code>text</code></a>.</p> |
| <p>public static <a href="/pages/WujORpjDCkwlen8RXp9y"><strong>replaceClosing()</strong></a><br>Replaces given <a href="/pages/WujORpjDCkwlen8RXp9y#closing-string"><code>closing</code></a> chars with a given <a href="/pages/WujORpjDCkwlen8RXp9y#replacevalue-string">replacement value</a> at the end of the given <a href="/pages/WujORpjDCkwlen8RXp9y#text-string"><code>text</code></a>.</p>                                                                                                                                                              |
| <p>public static <a href="/pages/s59NO2tosKIlfFAKOlMk"><strong>replaceOpening()</strong></a><br>Replaces given <a href="/pages/s59NO2tosKIlfFAKOlMk#opening-string"><code>opening</code></a> chars with a given <a href="/pages/s59NO2tosKIlfFAKOlMk#replacevalue-string">replacement value</a> at the beginning of the given <a href="/pages/s59NO2tosKIlfFAKOlMk#text-string"><code>text</code></a>.</p>                                                                                                                                                        |
| <p>public static <a href="/pages/T1V7Dv14L1UkuelGTN26"><strong>unwrap()</strong></a><br>The method returns the given <a href="/pages/T1V7Dv14L1UkuelGTN26#text-string"><code>text</code></a> without the given <a href="/pages/T1V7Dv14L1UkuelGTN26#opening-string"><code>opening</code></a> and <a href="/pages/T1V7Dv14L1UkuelGTN26#closing-string"><code>closing</code></a> chars.</p>                                                                                                                                                                         |
