7auto ltrim(
const std::string& str) -> std::string
9 auto str_modified = str;
14auto rtrim(
const std::string& str) -> std::string
16 auto str_modified = str;
21auto trim(
const std::string& str) -> std::string
23 auto str_modified = str;
28auto replace(
const std::string& str,
const std::string& search,
const std::string&
replace) -> std::string
30 auto str_modified = str;
35auto to_upper(
const std::string& str) -> std::string
37 auto str_modified = str;
42auto to_lower(
const std::string& str) -> std::string
44 auto str_modified = str;
49auto extract_substring(
const std::string& str,
const std::string& from,
const std::string& to) -> std::string
51 auto it_from = str.find(from);
52 if(it_from != std::string::npos)
54 auto result = str.substr(it_from + from.size(), std::string::npos);
55 auto it_to = result.find_first_of(to);
56 if(it_to != std::string::npos)
58 result = result.substr(0, it_to);
71 str.erase(str.begin(),
72 std::find_if(str.begin(),
76 return !std::isspace(ch);
82 str.erase(std::find_if(str.rbegin(),
86 return !std::isspace(ch);
98void replace(std::string& str,
const std::string& search,
const std::string&
replace)
106 while((pos = str.find(search, pos)) != std::string::npos)
108 str.replace(pos, search.length(),
replace);
115 std::transform(std::begin(str),
120 return std::toupper(c);
126 std::transform(std::begin(str),
131 return std::tolower(c);
140 auto last_pos = str.find_first_not_of(delimiters, 0);
142 auto pos = str.find_first_of(delimiters, last_pos);
144 while(std::string::npos != pos || std::string::npos != last_pos)
147 tokens.emplace_back(str.substr(last_pos, pos - last_pos));
149 last_pos = str.find_first_not_of(delimiters, pos);
151 pos = str.find_first_of(delimiters, last_pos);
void rtrim(std::string &str)
void replace(std::string &str, const std::string &search, const std::string &replace)
void to_lower(std::string &str)
void trim(std::string &str)
void to_upper(std::string &str)
void ltrim(std::string &str)
auto tokenize(const std::string &str, const std::string &delimiters) -> string_tokens_t
auto replace(const std::string &str, const std::string &search, const std::string &replace) -> std::string
auto extract_substring(const std::string &str, const std::string &from, const std::string &to) -> std::string
std::vector< std::string > string_tokens_t
auto to_lower(const std::string &str) -> std::string
auto trim(const std::string &str) -> std::string
auto ltrim(const std::string &str) -> std::string
auto to_upper(const std::string &str) -> std::string
auto rtrim(const std::string &str) -> std::string