From ce3bc101f3214afd5ec4056eb532896a88793ba0 Mon Sep 17 00:00:00 2001 From: Gliniak Date: Sun, 17 Mar 2024 21:03:28 +0100 Subject: [PATCH] [UTIL] Added remove_eol (end of line) to string_utils --- src/xenia/base/string_util.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/xenia/base/string_util.h b/src/xenia/base/string_util.h index 2bd14faa0..e8f720d45 100644 --- a/src/xenia/base/string_util.h +++ b/src/xenia/base/string_util.h @@ -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); }