[UTIL] Added remove_eol (end of line) to string_utils

This commit is contained in:
Gliniak 2024-03-17 21:03:28 +01:00 committed by Radosław Gliński
parent 9dc3127a50
commit ce3bc101f3
1 changed files with 6 additions and 0 deletions

View File

@ -156,6 +156,12 @@ inline std::string trim(const std::string& value) {
return ltrim(rtrim(value));
}
inline std::string remove_eol(const std::string& value) {
std::string result = value;
result.erase(std::remove(result.begin(), result.end(), '\n'), result.cend());
return result;
}
inline std::string to_hex_string(uint32_t value) {
return fmt::format("{:08X}", value);
}