# toString()

## `Wrap.prototype.toString()`

Gets the [wrap](https://docs.angular-package.dev/wrapper/getting-started/basic-concepts#wrap), the [primitive value](https://docs.angular-package.dev/wrapper/wrap/methods/instance/valueof) of a specified [`Wrap`](https://docs.angular-package.dev/wrapper/wrap) object.

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

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

```typescript
public toString(): `${Opening}${Text}${Closing}` {
  return super.toString() as `${Opening}${Text}${Closing}`;
}
```

{% endcode %}

### Return type

#### `${Opening}${Text}${Closing}`

The **return type** is the [template literal](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html) of generic type variables in order [`Opening`](https://docs.angular-package.dev/wrapper/generic-type-variables#wrap-opening), [`Text`](https://docs.angular-package.dev/wrapper/generic-type-variables#wrap-less-than...-text-...greater-than) and [`Closing`](https://docs.angular-package.dev/wrapper/generic-type-variables#wrap-closing).

### Returns

The **return value** is the wrap of generic type variables in order [`Opening`](https://docs.angular-package.dev/wrapper/generic-type-variables#wrap-opening), [`Text`](https://docs.angular-package.dev/wrapper/generic-type-variables#wrap-less-than...-text-...greater-than), and [`Closing`](https://docs.angular-package.dev/wrapper/generic-type-variables#wrap-closing) on the template.

## Example usage

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

// Returns [quote] of type "[quote]".
new Wrap(`[`, `]`, 'quote').toString();
```
