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

# Overview

The \`Wrap\` primitive wrapper object

## Wrap {}

The [`Wrap`](https://github.com/angular-package/wrapper/blob/main/src/lib/wrap.class.ts) object is based on the [`String`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) object and represents the [immutable](https://developer.mozilla.org/en-US/docs/Glossary/Immutable) [primitive value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/valueOf) of the [text](/wrapper-draft/getting-started/basic-concepts.md#wrap-content) wrapped by the [opening](/wrapper-draft/getting-started/basic-concepts.md#opening) and [closing](/wrapper-draft/getting-started/basic-concepts.md#closing) chars. It is designed to preserve the type names of the supplied opening, text, and closing chars by using the generic type variables.

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

{% embed url="<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#string_primitives_and_string_objects>" %}

{% embed url="<https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html>" %}

## Instance

### Accessors

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p>public get <a href="/wrapper-draft/wrap/accessors/get-closing.md"><strong>closing(): </strong><mark style="color:green;"><strong>Closing</strong></mark></a><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor gets the <a href="/wrapper-draft/getting-started/basic-concepts.md#closing">closing</a> of the wrap by returning the <a href="/wrapper-draft/wrap/properties/closing.md"><code>#closing</code></a> property of the specified object.</p>                                                                                                                                                                                                                      |
| <p>public get <a href="/wrapper-draft/wrap/accessors/get-opening.md"><strong>opening(): </strong><mark style="color:green;"><strong>Opening</strong></mark></a><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor gets the <a href="/wrapper-draft/getting-started/basic-concepts.md#opening">opening</a> of the wrap by returning the <a href="/wrapper-draft/wrap/properties/opening.md"><code>#opening</code></a> property of the specified object.</p>                                                                                                                                                                                                                      |
| <p>public get <a href="/wrapper-draft/wrap/accessors/get-text.md">t<strong>ext(): </strong><mark style="color:green;"><strong>Text</strong></mark></a><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor gets the <a href="/wrapper-draft/getting-started/basic-concepts.md#wrap-content">text</a> of the <a href="/wrapper-draft/wrap/overview.md"><code>Wrap</code></a> by returning the <a href="/wrapper-draft/wrap/properties/text.md"><code>#text</code></a> property of a specified object.</p>                                                                                                                                                                          |
| <p>public get <a href="/wrapper-draft/wrap/accessors/get-symbol.tostringtag.md"><strong>[Symbol.toStringTag](https://wrapper.angular-package.dev/wrapper-draft/wrap): </strong><mark style="color:green;"><strong>string</strong></mark></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>Wrap</code>.</p> |

### Properties

#### Private

|                                                                                                                                                                                                                                                                                                                         |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><a href="/wrapper-draft/wrap/properties/closing.md"><strong>#closing: </strong><mark style="color:green;"><strong>Closing</strong></mark></a><br>Private property of the closing chars of a generic type variable <a href="/wrapper-draft/wrap/generic-type-variables.md#wrap-closing"><code>Closing</code></a>.</p> |
| <p><a href="/wrapper-draft/wrap/properties/opening.md"><strong>#opening: </strong><mark style="color:green;"><strong>Opening</strong></mark></a><br>Private property of the opening chars of a generic type variable <a href="/wrapper-draft/wrap/generic-type-variables.md#wrap-opening"><code>Opening</code></a>.</p> |
| <p><a href="/wrapper-draft/wrap/properties/text.md"><strong>#text: </strong><mark style="color:green;"><strong>Text</strong></mark></a><br>Private property of text of a generic type variable <a href="/pages/SYPkCWCkQnshiX32nwLt#wrap-less-than...-text-...greater-than"><code>Text</code></a>.</p>                  |

### Methods

#### Public

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>public <a href="/wrapper-draft/wrap/methods/getclosing.md"><strong>getClosing()</strong></a><br>Gets the <a href="/wrapper-draft/getting-started/basic-concepts.md#closing">closing</a> chars of the wrap by returning the <a href="/wrapper-draft/wrap/properties.md#closing-closing"><code>#closing</code></a> property of a specified object.</p>                                                                                                                                                                                                                                                                      |
| <p>public <a href="/wrapper-draft/wrap/methods/getopening.md"><strong>getOpening()</strong></a><br>Gets the <a href="/wrapper-draft/getting-started/basic-concepts.md#opening">opening</a> chars of the wrap by returning the <a href="/wrapper-draft/wrap/properties.md#opening-opening"><code>#opening</code></a> property of a specified object.</p>                                                                                                                                                                                                                                                                      |
| <p>public <a href="/wrapper-draft/wrap/methods/gettext.md"><strong>getText()</strong></a><br>Gets the text of the wrap by returning the <a href="/wrapper-draft/wrap/properties/text.md"><code>#text</code></a> property of a specified object, without the <a href="/wrapper-draft/wrap/accessors/get-opening.md">opening</a> and <a href="/wrapper-draft/wrap/accessors/get-closing.md">closing</a> chars of the <a href="/wrapper-draft/wrap/overview.md"><code>Wrap</code></a>.</p>                                                                                                                                      |
| <p>public <a href="/wrapper-draft/wrap/methods/hasclosing.md"><strong>hasClosing()</strong></a><br>Checks whether the <a href="/wrapper-draft/wrap/methods/valueof.md">primitive value</a> of a specified object has the <a href="/wrapper-draft/wrap/accessors/get-closing.md"><code>closing</code></a> chars or given <a href="/wrapper-draft/wrap/methods/hasclosing.md#closing-string"><code>closing</code></a> chars.</p>                                                                                                                                                                                               |
| <p>public <a href="/wrapper-draft/wrap/methods/hasopening.md"><strong>hasOpening()</strong></a><br>Checks whether the <a href="/wrapper-draft/wrap/methods/valueof.md">primitive value</a> of a specified object has the <a href="/wrapper-draft/wrap/accessors/get-opening.md"><code>opening</code></a> chars or given <a href="/wrapper-draft/wrap/methods/hasopening.md#opening-string"><code>opening</code></a> chars.</p>                                                                                                                                                                                               |
| <p>public <a href="/wrapper-draft/wrap/methods/hastext.md"><strong>hasText()</strong></a><br>The method checks whether the <a href="/wrapper-draft/wrap/accessors/get-text.md"><code>text</code></a> of a specified <a href="/wrapper-draft/wrap/overview.md"><code>Wrap</code></a> object is defined, which means it's a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String"><code>string</code></a> of at least one char and optionally equal to the given <a href="/wrapper-draft/wrap/methods/hastext.md#text-string"><code>text</code></a>.</p>                           |
| <p>public <a href="/wrapper-draft/wrap/methods/iswrapped.md"><strong>isWrapped()</strong></a><br>The method checks whether the <a href="/wrapper-draft/wrap/methods/valueof.md">primitive value</a> of the specified object is wrapped by the <a href="/wrapper-draft/wrap/accessors/get-opening.md">opening</a> and <a href="/wrapper-draft/wrap/accessors/get-closing.md">closing</a> chars of an instance or given <a href="/pages/VDTORK00NPJgmbN7aELv#opening-string-this.-opening"><code>opening</code></a> and <a href="/pages/VDTORK00NPJgmbN7aELv#closing-string-this.-closing"><code>closing</code></a> chars.</p> |
| <p>public <a href="/wrapper-draft/wrap/methods/replaceclosing.md"><strong>★ replaceClosing()</strong></a><br>Returns the <a href="/wrapper-draft/wrap/methods/valueof.md">primitive value</a> with replaced <a href="/wrapper-draft/wrap/accessors/get-closing.md"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                                                                                                                       |
| <p>public <a href="/wrapper-draft/wrap/methods/replaceopening.md"><strong>★ replaceOpening()</strong></a><br>Returns the <a href="/wrapper-draft/wrap/methods/valueof.md">primitive value</a> with replaced <a href="/wrapper-draft/wrap/accessors/get-opening.md"><code>opening</code></a> chars.</p>                                                                                                                                                                                                                                                                                                                       |
| <p>public <a href="/wrapper-draft/wrap/methods/replacetext.md"><strong>★ replaceText()</strong></a><br>Returns the <a href="/wrapper-draft/wrap/methods/valueof.md">primitive value</a> with replaced <a href="/wrapper-draft/wrap/accessors/get-text.md"><code>text</code></a>.</p>                                                                                                                                                                                                                                                                                                                                         |
| <p>public <a href="/wrapper-draft/wrap/methods/tostring.md"><strong>toString()</strong></a><br>Gets the <a href="/wrapper-draft/getting-started/basic-concepts.md#wrap">wrap</a>, the <a href="/wrapper-draft/wrap/methods/valueof.md">primitive value</a> of a specified <a href="#wrap"><code>Wrap</code></a> object.</p>                                                                                                                                                                                                                                                                                                  |
| <p>public <a href="/wrapper-draft/wrap/methods/valueof.md"><strong>valueOf()</strong></a><br>Returns the <a href="/wrapper-draft/getting-started/basic-concepts.md#wrap">wrap</a>, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/valueOf">primitive value</a> of a specified <a href="/wrapper-draft/wrap/overview.md"><code>Wrap</code></a> object.</p>                                                                                                                                                                                                                  |

## Static

### Methods

#### Public

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>public static <a href="/wrapper-draft/wrap/methods/static-hasclosing.md"><strong>hasClosing()</strong></a><br>Checks whether the <a href="/wrapper-draft/wrap/methods/static-hasclosing.md#text-string"><code>text</code></a> has given <a href="/wrapper-draft/wrap/methods/static-hasclosing.md#closing-string"><code>closing</code></a> chars at the end.</p>                                                                                                                                                             |
| <p>public static <a href="/wrapper-draft/wrap/methods/static-hasopening.md"><strong>hasOpening()</strong></a><br>Checks whether the <a href="/wrapper-draft/wrap/methods/static-hasopening.md#text-string"><code>text</code></a> has given <a href="/wrapper-draft/wrap/methods/static-hasopening.md#opening-string"><code>opening</code></a> chars at the beginning.</p>                                                                                                                                                       |
| <p>public static <a href="/wrapper-draft/wrap/methods/static-iswrap.md"><strong>isWrap()</strong></a><br>The method checks whether the <a href="/wrapper-draft/wrap/methods/static-iswrap.md#value-any"><code>value</code></a> of any type is the <a href="#wrap"><code>Wrap</code></a> instance of any or given <a href="/wrapper-draft/wrap/methods/static-iswrap.md#opening-opening"><code>opening</code></a> and <a href="/wrapper-draft/wrap/methods/static-iswrap.md#closing-closing"><code>closing</code></a> chars.</p> |
