Kurlyk
Toggle main menu visibility
Loading...
Searching...
No Matches
string_utils.hpp
Go to the documentation of this file.
1
#pragma once
2
#ifndef KURLYK_HEADER_KURLYK_UTILS_STRING_UTILS_HPP_INCLUDED
3
#define KURLYK_HEADER_KURLYK_UTILS_STRING_UTILS_HPP_INCLUDED
4
7
8
#include <string>
9
#include <algorithm>
10
#include <cctype>
11
12
namespace
kurlyk
{
13
namespace
utils {
14
18
inline
std::string
to_upper_case
(std::string str) {
19
std::transform(str.begin(), str.end(), str.begin(), [](
unsigned
char
ch) {
20
return static_cast<char>(std::toupper(ch));
21
});
22
return
str;
23
}
24
28
inline
std::string
to_lower_case
(std::string str) {
29
std::transform(str.begin(), str.end(), str.begin(), [](
unsigned
char
ch) {
30
return static_cast<char>(std::tolower(ch));
31
});
32
return
str;
33
}
34
35
}
// namespace utils
36
}
// namespace kurlyk
37
38
#endif
// KURLYK_HEADER_KURLYK_UTILS_STRING_UTILS_HPP_INCLUDED
kurlyk::utils::to_upper_case
std::string to_upper_case(std::string str)
Converts a string to uppercase.
Definition
string_utils.hpp:18
kurlyk::utils::to_lower_case
std::string to_lower_case(std::string str)
Converts a string to lowercase.
Definition
string_utils.hpp:28
kurlyk
Primary namespace for the Kurlyk library, encompassing initialization, request management,...
include
kurlyk
utils
string_utils.hpp
Generated by
1.17.0