static hasOpening()
Checks whether the text has given opening chars at the beginning.
Wrap.hasOpening()
Wrap.hasOpening()public static hasOpening(text: string, opening: string): boolean {
return (
typeof text === 'string' &&
text.length >= 1 &&
typeof opening === 'string' &&
opening.length >= 1 &&
text.slice(0, opening.length) === opening
);
}Parameters
text: string
text: stringopening: string
opening: stringReturns
Example usage
Last updated