mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 19:29:16 +00:00
AK: Add to_string() method to StringView
This allows easy creation of a new string from an existing StringView.
Can be used e.g. for output with printf(..., view.to_string().characters())
instead of writing printf(..., String{view}.characters()).
This commit is contained in:
committed by
Andreas Kling
parent
c7568943d9
commit
8fe821fae2
@@ -264,4 +264,6 @@ Optional<size_t> StringView::find_last_of(const StringView& view) const
|
||||
return {};
|
||||
}
|
||||
|
||||
String StringView::to_string() const { return String { *this }; }
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user