18 std::ranges::for_each(s, [&rv](
char const &c) { rv +=
static_cast<char>(std::tolower(c)); });
31 std::ranges::for_each(s, [&rv](
char const &c) { rv +=
static_cast<char>(std::toupper(c)); });
40 constexpr std::string_view
ltrimview(std::string_view
const s)
noexcept
42 return std::string_view(std::ranges::find_if(s, [](
unsigned char ch) {
return !std::isspace(ch); }), s.end());
50 constexpr std::string_view
rtrimview(std::string_view
const s)
noexcept
52 return std::string_view(
53 s.begin(), std::find_if(s.rbegin(), s.rend(), [](
unsigned char ch) { return !std::isspace(ch); }).base());
68 inline std::string
ltrim(std::string
const &s)
noexcept {
return std::string(
ltrimview(s)); }
74 inline std::string
rtrim(std::string
const &s)
noexcept {
return std::string(
rtrimview(s)); }
81 inline std::string
trim(std::string
const &s)
noexcept {
return std::string(
trimview(s)); }