diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-07-03 14:56:27 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-07-03 14:56:27 +0200 |
commit | b79112e6d6c572ad32d247ceb022cc1dda413d25 (patch) | |
tree | 524e340746c4e5bf991e3cdab9ee724a21ee1da1 /AK/AKString.h | |
parent | 8ac2b30de7550ae42a4660802dc9e5ec1223ac70 (diff) | |
download | serenity-b79112e6d6c572ad32d247ceb022cc1dda413d25.zip |
AK: Add String::number() for creating a String from a number.
Instead of manually doing String::format("%d"/"%u") everywhere, let's have
a String API for this. It's just a wrapper around format() for now, but it
could be made more efficient in the future.
Diffstat (limited to 'AK/AKString.h')
-rw-r--r-- | AK/AKString.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/AK/AKString.h b/AK/AKString.h index a7de84b856..70e0fb0917 100644 --- a/AK/AKString.h +++ b/AK/AKString.h @@ -181,6 +181,8 @@ public: } static String format(const char*, ...); + static String number(unsigned); + static String number(int); StringView view() const { return { characters(), length() }; } |