blob: 1b9e9ba27e60149d8ecca3aad38d4c89c197d21f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
--- src/shared_modules/utils/stringHelper.h 2023-12-09 01:08:14.397366000 -0500
+++ src/shared_modules/utils/stringHelper.h 2023-12-09 12:07:52.155984000 -0500
@@ -210,6 +210,17 @@
return leftTrim(rightTrim(str, args), args);
}
+ static std::string trimToOneSpace(const std::string& str)
+ {
+ std::string str_output;
+
+ str_output.clear();
+ std::unique_copy (str.begin(), str.end(), std::back_insert_iterator<std::string>(str_output),
+ [](char a,char b){ return std::isspace(a) && std::isspace(b);});
+
+ return str_output;
+ }
+
static std::string toUpperCase(const std::string& str)
{
std::string temp{ str };
@@ -219,6 +230,19 @@
[](std::string::value_type character)
{
return std::toupper(character);
+ });
+ return temp;
+ }
+
+ static std::string toLowerCase(const std::string& str)
+ {
+ std::string temp{ str };
+ std::transform(std::begin(temp),
+ std::end(temp),
+ std::begin(temp),
+ [](std::string::value_type character)
+ {
+ return std::tolower(character);
});
return temp;
}
|