Added containsIgnoreCase() as shortcut for findIgnoreCase() != end().

This commit is contained in:
Patrick Wuttke 2025-10-28 12:02:16 +01:00
parent 0e1964ba25
commit 5e71b0ff9e

View File

@ -864,6 +864,12 @@ inline auto findIgnoreCase(std::string_view haystack, std::string_view needle)
return std::ranges::search(haystack, needle, &compareIgnoreCase<char>);
}
[[nodiscard]]
inline bool containsIgnoreCase(std::string_view haystack, std::string_view needle)
{
return findIgnoreCase(haystack, needle).begin() != haystack.end();
}
[[nodiscard]]
inline bool startsWithIgnoreCase(std::string_view string, std::string_view part)
{