endsWith
Checks if the input string ends with the specified substring.
endsWith
Checks if the input string ends with the specified substring.
Type: transform
Parameters
- input (unknown): The input string to check.
- search (string): The substring to search for at the end.
Returns
Type: boolean
True if the input ends with the search string, false otherwise.
Examples
endsWith("hello world", "world") // true
"foo-bar"|endsWith("bar") // true
endsWith("test", "xyz") // false