aboutsummaryrefslogtreecommitdiff
path: root/src/common/String.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/String.cpp')
-rw-r--r--src/common/String.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common/String.cpp b/src/common/String.cpp
index 743a33fd..8d674369 100644
--- a/src/common/String.cpp
+++ b/src/common/String.cpp
@@ -211,6 +211,15 @@ String::iterator String::erase(const_iterator start, const_iterator end) {
return s;
}
+String& String::TrimEnd() {
+ if (size_ == 0) return *this;
+ while (size_ > 0 && IsWhitespace(buffer_[size_ - 1])) {
+ size_--;
+ }
+
+ return *this;
+}
+
std::string String::ToUtf8() const { return cru::ToUtf8(buffer_, size_); }
void String::AppendCodePoint(CodePoint code_point) {