# ⚠  textHasOpening()

{% hint style="danger" %}
The method does not yet exist.&#x20;
{% endhint %}

### `Wrapper.prototype.textHasOpening()`

Checks if the provided `text` has the opening of the specified [`Wrapper`](https://wrapper.angular-package.dev/wrapper/methods/instance/broken-reference) object at the beginning of the text.

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

```typescript
public textHasOpening(text: string): boolean {
  return (
    isStringType(text) && text.slice(0, this.opening.length) === this.opening
  );
}
```

{% endcode %}

### Parameters

<table><thead><tr><th width="173.44477578337126">Name: type</th><th>Description</th></tr></thead><tbody><tr><td><code>text: string</code></td><td>The text of a <code>string</code> to test against the existence of the <a href="../../../../wrap/accessors#wrap.prototype.opening"><code>opening</code></a> chars.</td></tr></tbody></table>

### Returns

The **return value** is a [`boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) indicating whether the given `text` has the opening of the wrap.

### Example usage

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

// Returns true of boolean.
new Wrapper(`[`, `]`).textHasOpening(`[quote]`);
```
