⚠ textHasOpening()
The method does not yet exist.
Wrapper.prototype.textHasOpening()
Wrapper.prototype.textHasOpening()
Checks if the provided text
has the opening of the specified Wrapper
object at the beginning of the text.
public textHasOpening(text: string): boolean {
return (
isStringType(text) && text.slice(0, this.opening.length) === this.opening
);
}
Parameters
Name: type
Description
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
Was this helpful?