1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:47:44 +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:
Andreas Kling 2018-11-07 00:19:35 +01:00
parent 90bab5ea71
commit 8135952832
4 changed files with 19 additions and 9 deletions

View file

@ -24,13 +24,13 @@ public:
{
}
String(const char* cstring)
: m_impl(StringImpl::create(cstring))
String(const char* cstring, ShouldChomp shouldChomp = NoChomp)
: m_impl(StringImpl::create(cstring, shouldChomp))
{
}
String(const char* cstring, size_t length)
: m_impl(StringImpl::create(cstring, length))
String(const char* cstring, size_t length, ShouldChomp shouldChomp = NoChomp)
: m_impl(StringImpl::create(cstring, length, shouldChomp))
{
}