mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:07:45 +00:00
AK: Add StringBuilder::length() and trim(int)
Sometimes you want to trim a byte or two off the end.
This commit is contained in:
parent
b5c587a106
commit
99fc7033b5
1 changed files with 3 additions and 0 deletions
|
@ -27,6 +27,9 @@ public:
|
||||||
StringView string_view() const;
|
StringView string_view() const;
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
|
int length() const { return m_length; }
|
||||||
|
void trim(int count) { m_length -= count; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void will_append(int);
|
void will_append(int);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue