mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 19:07:34 +00:00
Add a Chomp feature to String construction that removes a trailing newline.
This will be useful in many situations.
This commit is contained in:
parent
90bab5ea71
commit
8135952832
4 changed files with 19 additions and 9 deletions
|
@ -6,11 +6,13 @@
|
|||
|
||||
namespace AK {
|
||||
|
||||
enum ShouldChomp { NoChomp, Chomp };
|
||||
|
||||
class StringImpl : public Retainable<StringImpl> {
|
||||
public:
|
||||
static RetainPtr<StringImpl> createUninitialized(size_t length, char*& buffer);
|
||||
static RetainPtr<StringImpl> create(const char* cstring);
|
||||
static RetainPtr<StringImpl> create(const char* cstring, size_t length);
|
||||
static RetainPtr<StringImpl> create(const char* cstring, ShouldChomp = NoChomp);
|
||||
static RetainPtr<StringImpl> create(const char* cstring, size_t length, ShouldChomp = NoChomp);
|
||||
RetainPtr<StringImpl> toLowercase() const;
|
||||
RetainPtr<StringImpl> toUppercase() const;
|
||||
|
||||
|
@ -50,3 +52,4 @@ private:
|
|||
}
|
||||
|
||||
using AK::StringImpl;
|
||||
using AK::Chomp;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue