# isOpeningIn()

## `Wrapper.prototype.isOpeningIn()`

Checks whether the provided [`text`](#text-string) has the [`opening`](https://wrapper.angular-package.dev/wrap/accessors/opening) chars of a specified [`Wrapper`](https://wrapper.angular-package.dev/wrapper) object at the **beginning**.

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

```typescript
public isOpeningIn(text: string): boolean {
  return Wrapper.hasOpening(text, this.opening);
}
```

{% endcode %}

### Parameters

#### `text: string`

The **text** of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) to test for the existence of the [`opening`](https://wrapper.angular-package.dev/wrap/accessors/opening) chars at the **beginning** of it.

### 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`](#text-string) has the [`opening`](https://wrapper.angular-package.dev/wrap/accessors/opening) chars  of the wrap.

### Example usage

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

const longText = new Wrapper('{{', '}}', 'This is a long text');
const text = `Lorem ipsum and more`;

// Returns false.
longText.isOpeningIn(`${text}${longText.opening}`);

// Returns false.
longText.isOpeningIn(text);

// Returns true.
longText.isOpeningIn(`${longText.opening}${text}`);
```
