From b18347ffc9db9641e215995edea1c04c363b2bdf Mon Sep 17 00:00:00 2001 From: Angelo Rossi Date: Wed, 21 Jun 2023 12:04:16 +0000 Subject: Initial commit. --- sources/strcom.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 sources/strcom.cpp (limited to 'sources/strcom.cpp') 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 -- cgit v1.2.3