summaryrefslogtreecommitdiffstats
path: root/sources/strcom.cpp
diff options
context:
space:
mode:
authorAngelo Rossi <angelo.rossi.homelab@gmail.com>2023-06-21 12:04:16 +0000
committerAngelo Rossi <angelo.rossi.homelab@gmail.com>2023-06-21 12:04:16 +0000
commitb18347ffc9db9641e215995edea1c04c363b2bdf (patch)
treef3908dc911399f1a21e17d950355ee56dc0919ee /sources/strcom.cpp
Initial commit.
Diffstat (limited to 'sources/strcom.cpp')
-rw-r--r--sources/strcom.cpp33
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