diff --git a/AK/StringView.cpp b/AK/StringView.cpp index 88a4d9217b9..f65e324a3fb 100644 --- a/AK/StringView.cpp +++ b/AK/StringView.cpp @@ -264,4 +264,6 @@ Optional StringView::find_last_of(const StringView& view) const return {}; } +String StringView::to_string() const { return String { *this }; } + } diff --git a/AK/StringView.h b/AK/StringView.h index 3d7105888d4..e82dbf54559 100644 --- a/AK/StringView.h +++ b/AK/StringView.h @@ -152,6 +152,8 @@ public: const StringImpl* impl() const { return m_impl; } + String to_string() const; + private: friend class String; const StringImpl* m_impl { nullptr };