Kurlyk
Loading...
Searching...
No Matches
string_utils.hpp
Go to the documentation of this file.
1
#pragma once
2
#ifndef _KURLYK_UTILS_STRING_UTILS_HPP_INCLUDED
3
#define _KURLYK_UTILS_STRING_UTILS_HPP_INCLUDED
4
7
8
#include <string>
9
#include <algorithm>
10
11
namespace
kurlyk::utils
{
12
16
inline
std::string
to_upper_case
(std::string str) {
17
std::transform(str.begin(), str.end(), str.begin(), [](
unsigned
char
ch) {
18
return static_cast<char>(std::toupper(ch));
19
});
20
return
str;
21
}
22
26
inline
std::string
to_lower_case
(std::string str) {
27
std::transform(str.begin(), str.end(), str.begin(), [](
unsigned
char
ch) {
28
return static_cast<char>(std::tolower(ch));
29
});
30
return
str;
31
}
32
33
}
// namespace kurlyk::utils
34
35
#endif
// _KURLYK_UTILS_STRING_UTILS_HPP_INCLUDED
kurlyk::utils
Definition
CaseInsensitiveMultimap.hpp:8
kurlyk::utils::to_upper_case
std::string to_upper_case(std::string str)
Converts a string to uppercase.
Definition
string_utils.hpp:16
kurlyk::utils::to_lower_case
std::string to_lower_case(std::string str)
Converts a string to lowercase.
Definition
string_utils.hpp:26
include
kurlyk
utils
string_utils.hpp
Generated by
1.13.2