diff options
author | Angelo Rossi <angelo.rossi.homelab@gmail.com> | 2023-06-21 12:04:16 +0000 |
---|---|---|
committer | Angelo Rossi <angelo.rossi.homelab@gmail.com> | 2023-06-21 12:04:16 +0000 |
commit | b18347ffc9db9641e215995edea1c04c363b2bdf (patch) | |
tree | f3908dc911399f1a21e17d950355ee56dc0919ee /sources/strcom.cpp |
Initial commit.
Diffstat (limited to 'sources/strcom.cpp')
-rw-r--r-- | sources/strcom.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/sources/strcom.cpp b/sources/strcom.cpp new file mode 100644 index 0000000..f885d77 --- /dev/null +++ b/sources/strcom.cpp @@ -0,0 +1,33 @@ +//-*- mode: c++; indent-tabs-mode: t; coding: utf-8; show-trailing-whitespace: t -*- + +// file strcom.cpp + +#include "strcom.hpp" + +namespace strcom { + + std::string toLower (const std::string &s) + { + std::string sTemp = s; + // + std::for_each (sTemp.begin (), sTemp.end (), [](char &c) + { + c = std::tolower (c); + }); + return sTemp; + } + + std::string toUpper (const std::string &s) + { + std::string sTemp = s; + // + std::for_each (sTemp.begin (), sTemp.end (), [](char &c) + { + c = std::toupper (c); + }); + return sTemp; + } + +} + +// end of file strcom.cpp |