# ⚠  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`](broken://pages/OnxhYXL7HocXsHa9qO3M) 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="/pages/QTYxQh3MKwTJRj5pYA28#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]`);
```


---

# 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-draft/wrapper/methods/texthasopening.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.
