MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / StrEndsWithIgnoreCase

Function StrEndsWithIgnoreCase

src/string.cpp:297–301  ·  view source on GitHub ↗

* Check whether the given string ends with the given suffix, ignoring case. * @param str The string to look at. * @param suffix The suffix to look for. * @return True iff the end of the string is the same as the suffix, ignoring case. */

Source from the content-addressed store, hash-verified

295 * @return True iff the end of the string is the same as the suffix, ignoring case.
296 */
297bool StrEndsWithIgnoreCase(std::string_view str, std::string_view suffix)
298{
299 if (str.size() < suffix.size()) return false;
300 return StrEqualsIgnoreCase(str.substr(str.size() - suffix.size()), suffix);
301}
302
303/**
304 * Compares two string( view)s, while ignoring the case of the characters.

Callers 3

NavigateToFileMethod · 0.85
AfterLoadTextMethod · 0.85
string_func.cppFile · 0.85

Calls 3

StrEqualsIgnoreCaseFunction · 0.85
substrMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected