diff --git a/src/utils.cpp b/src/utils.cpp index ddda61e..3b1426c 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -36,3 +36,8 @@ std::vector strsplit(const std::string& str, const std::string& del r.push_back(str.substr(s)); return r; } + +void strtolower(std::string& str) { + + std::transform(str.begin(), str.end(), str.begin(), [](unsigned char c){ return std::tolower(c); }); +} diff --git a/src/utils.h b/src/utils.h index ad3d4c2..120bf7c 100644 --- a/src/utils.h +++ b/src/utils.h @@ -29,4 +29,6 @@ std::vector strsplit(const std::string& str, const std::string& delim); +void strtolower(std::string& str); + #endif /* UTILS_H */