⚠ textHasOpening()

The method does not yet exist.

Wrapper.prototype.textHasOpening()

Checks if the provided text has the opening of the specified Wrapper object at the beginning of the text.

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

Parameters

Name: typeDescription

text: string

The text of a string to test against the existence of the opening chars.

Returns

The return value is a boolean indicating whether the given text has the opening of the wrap.

Example usage

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

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

Last updated