25 #ifndef INC_STRUTIL_HPP_11067707_AB86_4996_AB0A_086A9EFB75B7
26 #define INC_STRUTIL_HPP_11067707_AB86_4996_AB0A_086A9EFB75B7
37 void ltrim(std::string &s);
40 void rtrim(std::string &s);
43 void trim(std::string &s);
56 std::string
replaceAllCopy(std::string str,
const std::string& from,
const std::string& to);
59 void replaceAll(std::string& str,
const std::string& from,
const std::string& to);
63 bool stringICompare(
const std::string& str1,
const std::string& str2);
72 #if defined(__cpp_lib_char8_t)
void replaceAll(std::string &str, const std::string &from, const std::string &to)
Replace in-place all occurrences of a substring by another in a string.
void ltrim(std::string &s)
Trim from start (in place).
void rtrim(std::string &s)
Trim from end (in place).
std::string trim_copy(std::string s)
Trim from both ends (copying).
std::string rtrim_copy(std::string s)
Trim from end (copying).
void trim(std::string &s)
Trim from both ends (in place).
bool stringICompare(const std::string &str1, const std::string &str2)
Case-insensitive comparison of two strings.
time_t parseISO8601(const std::string &iso8601)
Parse ISO 8601 date/time.
std::string from_u8string(const std::string &s)
Returns an UTF-8 encoded string in an object of type std::string (C++17).
std::string escapeForXML(const std::string &str)
Escapes a string for writing it in a XML stream.
std::string ltrim_copy(std::string s)
Trim from start (copying).
std::string replaceAllCopy(std::string str, const std::string &from, const std::string &to)
Replace all occurrences of a substring by another in a string.