Added findIgnoreCase() utility function.

This commit is contained in:
Patrick Wuttke 2025-03-18 15:07:55 +01:00
parent cd66b76a8f
commit a64bfde6af

View File

@ -387,6 +387,15 @@ constexpr bool isHexadecimalChar(TChar chr) noexcept
|| (chr >= TChar('a') && chr <= TChar('f')); || (chr >= TChar('a') && chr <= TChar('f'));
} }
[[nodiscard]]
inline auto findIgnoreCase(std::string_view haystack, std::string_view needle)
{
return std::ranges::search(haystack, needle, [](char left, char right)
{
return std::tolower(left) == std::tolower(right);
});
}
namespace pipe namespace pipe
{ {
struct Join struct Join