Check if a string ends with a specified substring, case-insensitive.
The string to check.
The substring to check if it's at the end of the string.
True if the string ends with the specified substring, false otherwise.
// returns trueconst result = endsWith('JavaScript', 'script'); Copy
// returns trueconst result = endsWith('JavaScript', 'script');
Use the built-in endsWith, lowercasing both strings for the same case-insensitive check: str.toLowerCase().endsWith(ends.toLowerCase()). Will be removed in goldies 6.0.
endsWith
str.toLowerCase().endsWith(ends.toLowerCase())
Check if a string ends with a specified substring, case-insensitive.