mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 02:57:42 +00:00
AK: Add split()
for String
This commit is contained in:
parent
4f5353cbb8
commit
aec2dadfdd
3 changed files with 54 additions and 0 deletions
|
@ -16,6 +16,7 @@
|
|||
#include <AK/StringView.h>
|
||||
#include <AK/Traits.h>
|
||||
#include <AK/Types.h>
|
||||
#include <AK/Vector.h>
|
||||
|
||||
namespace AK {
|
||||
|
||||
|
@ -101,6 +102,9 @@ public:
|
|||
ErrorOr<String> replace(StringView needle, StringView replacement, ReplaceMode replace_mode) const;
|
||||
ErrorOr<String> reverse() const;
|
||||
|
||||
[[nodiscard]] ErrorOr<Vector<String>> split_limit(u32 separator, size_t limit, SplitBehavior = SplitBehavior::Nothing) const;
|
||||
[[nodiscard]] ErrorOr<Vector<String>> split(u32 separator, SplitBehavior = SplitBehavior::Nothing) const;
|
||||
|
||||
[[nodiscard]] bool operator==(String const&) const;
|
||||
[[nodiscard]] bool operator!=(String const& other) const { return !(*this == other); }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue