summaryrefslogtreecommitdiff
path: root/Source/Core/Common/StringUtil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/Common/StringUtil.cpp')
-rw-r--r--Source/Core/Common/StringUtil.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/Core/Common/StringUtil.cpp b/Source/Core/Common/StringUtil.cpp
index 80c74ac8a7..6548205fb0 100644
--- a/Source/Core/Common/StringUtil.cpp
+++ b/Source/Core/Common/StringUtil.cpp
@@ -405,6 +405,12 @@ bool StringEndsWith(const std::string& str, const std::string& end)
return str.size() >= end.size() && std::equal(end.rbegin(), end.rend(), str.rbegin());
}
+void StringPopBackIf(std::string* s, char c)
+{
+ if (!s->empty() && s->back() == c)
+ s->pop_back();
+}
+
#ifdef _WIN32
std::string UTF16ToUTF8(const std::wstring& input)