mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
AK: Add StringView::split_view() taking a StringView
Since the task of splitting a string via another is pretty common, we might as well have this overload of split_view() as well.
This commit is contained in:
parent
d83d46fd7a
commit
f9bf2c7e78
Notes:
sideshowbarker
2024-07-19 06:03:03 +09:00
Author: https://github.com/alimpfard
Commit: f9bf2c7e78
Pull-request: https://github.com/SerenityOS/serenity/pull/2416
Reviewed-by: https://github.com/bugaevc
2 changed files with 28 additions and 1 deletions
|
@ -88,6 +88,7 @@ public:
|
|||
|
||||
StringView substring_view(size_t start, size_t length) const;
|
||||
Vector<StringView> split_view(char, bool keep_empty = false) const;
|
||||
Vector<StringView> split_view(const StringView&, bool keep_empty = false) const;
|
||||
|
||||
// Create a Vector of StringViews split by line endings. As of CommonMark
|
||||
// 0.29, the spec defines a line ending as "a newline (U+000A), a carriage
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue