1 #ifndef _utl_StringCompare_h_
2 #define _utl_StringCompare_h_
27 {
return std::tolower(a) == std::tolower(b); }
35 template<
class Predicate>
40 return a.size() == b.size() && std::equal(a.begin(), a.end(), b.begin(),
p);
59 template<
class Predicate>
64 return std::search(a.begin(), a.end(), b.begin(), b.end(),
p) != a.end();
bool StringEquivalent(const std::string &a, const std::string &b, Predicate p)
Utility to compare strings for equivalence. It takes a predicate to determine the equivalence of indi...
bool ContainsSubstring(const std::string &a, const std::string &b, Predicate p)
Utility to search for a substring within a string according to a given search predicate.
bool ContainsSubstringEquivalent(const std::string &a, const std::string &b)
Syntactic sugar for searching within a string for a substring. Search is case-insensitive.
Utility class to compare characters in a case-independent way.
bool operator()(const char a, const char b) const