string-ends-with-x
Determines whether a string ends with the characters of a specified string.
module.exports
⇒ boolean
⏏
This method determines whether a string begins with the characters of a specified string, returning true or false as appropriate.
Kind: Exported member
Returns: boolean
- true
if the given characters are found at the end
of the string; otherwise, false
.
Throws:
TypeError
If string is null or undefined.TypeError
If searchString is a RegExp.
Param | Type | Description |
---|---|---|
string | string |
The string to be search. |
searchString | string |
The characters to be searched for at the end of this string. |
Example
; const str = 'To be, or not to be, that is the question.'; console; // trueconsole; // falseconsole; // true