From 99fc7033b56d474cb7259d85992db007373c5744 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 29 Sep 2019 16:20:09 +0200 Subject: [PATCH] AK: Add StringBuilder::length() and trim(int) Sometimes you want to trim a byte or two off the end. --- AK/StringBuilder.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AK/StringBuilder.h b/AK/StringBuilder.h index b5f9a887f78..9c4694bfdfc 100644 --- a/AK/StringBuilder.h +++ b/AK/StringBuilder.h @@ -27,6 +27,9 @@ public: StringView string_view() const; void clear(); + int length() const { return m_length; } + void trim(int count) { m_length -= count; } + private: void will_append(int);