cmpsc330hw4/utils.cxx
2024-11-19 22:36:16 -05:00

13 lines
312 B
C++

#include <string>
char toLowerCase(const char c) {
return c | 32;
}
bool equalsIgnoreCase(const std::string &a, const std::string &b) {
if (a.size() != b.size()) return false;
for (size_t i = 0; i < a.size(); ++i) {
if (tolower(a[i]) != tolower(b[i])) return false;
}
return true;
}