Browse Source

std_utils - add to_lower(string)

LIB-18
heck 11 months ago
parent
commit
528d823b19
2 changed files with 10 additions and 0 deletions
  1. +9
    -0
      src/std_utils.cc
  2. +1
    -0
      src/std_utils.hh

+ 9
- 0
src/std_utils.cc View File

@ -285,6 +285,15 @@ namespace pEp {
return ret;
}
std::string to_lower(const std::string &data)
{
std::string ret{ data };
std::transform(ret.begin(), ret.end(), ret.begin(), [](unsigned char c) {
return std::tolower(c);
});
return ret;
}
string to_termcol(const Color &col)
{
switch (col) {


+ 1
- 0
src/std_utils.hh View File

@ -69,6 +69,7 @@ namespace pEp {
std::string padTo(const std::string &str, const size_t num, const char paddingChar);
std::string clip(const std::string &str, const size_t len);
std::string tldr(const std::string &str, const size_t len);
std::string to_lower(const std::string& data);
enum class Color
{


Loading…
Cancel
Save