JSON-RPC 2.0
JSON-RPC 2.0 Modern C++ Library
Loading...
Searching...
No Matches
string_utils.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cctype>
4#include <ranges>
5#include <string>
6#include <string_view>
7
8namespace jsonrpc::utils {
9
10auto Trim(std::string_view in) -> std::string {
11 auto view = in | std::views::drop_while(::isspace) | std::views::reverse |
12 std::views::drop_while(::isspace) | std::views::reverse;
13 return {view.begin(), view.end()};
14}
15
16} // namespace jsonrpc::utils
auto Trim(std::string_view in) -> std::string