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

Function StrContainsIgnoreCase

src/string.cpp:336–341  ·  view source on GitHub ↗

* Checks if a string is contained in another string, while ignoring the case of the characters. * * @param str The string to search in. * @param value The string to search for. * @return True if a match was found. */

Source from the content-addressed store, hash-verified

334 * @return True if a match was found.
335 */
336bool StrContainsIgnoreCase(std::string_view str, std::string_view value)
337{
338 CaseInsensitiveStringView ci_str{ str.data(), str.size() };
339 CaseInsensitiveStringView ci_value{ value.data(), value.size() };
340 return ci_str.find(ci_value) != ci_str.npos;
341}
342
343/**
344 * Get the length of an UTF-8 encoded string in number of characters

Callers 4

AddLineMethod · 0.85
ConContentFunction · 0.85
LoadFontMethod · 0.85
TryLoadFontFromFileMethod · 0.85

Calls 3

dataMethod · 0.45
sizeMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected