diff options
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/tolower.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/utils/tolower.hpp b/src/utils/tolower.hpp new file mode 100644 index 0000000..22d2b8f --- /dev/null +++ b/src/utils/tolower.hpp @@ -0,0 +1,18 @@ +#ifndef TOLOWER_INCLUDED +# define TOLOWER_INCLUDED + +#include <string> + +namespace utils +{ + std::string tolower(const std::string& original) + { + std::string res; + res.reserve(original.size()); + for (const char c: original) + res += static_cast<char>(std::tolower(c)); + return res; + } +} + +#endif // SPLIT_INCLUDED |