mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:17:44 +00:00
AK: Add String::join() helper function
This is a simple wrapper around StringBuilder::join().
This commit is contained in:
parent
e83799dc02
commit
7ad9b116f7
1 changed files with 10 additions and 0 deletions
10
AK/String.h
10
AK/String.h
|
@ -30,6 +30,7 @@
|
||||||
#include <AK/Forward.h>
|
#include <AK/Forward.h>
|
||||||
#include <AK/RefPtr.h>
|
#include <AK/RefPtr.h>
|
||||||
#include <AK/Stream.h>
|
#include <AK/Stream.h>
|
||||||
|
#include <AK/StringBuilder.h>
|
||||||
#include <AK/StringImpl.h>
|
#include <AK/StringImpl.h>
|
||||||
#include <AK/StringUtils.h>
|
#include <AK/StringUtils.h>
|
||||||
#include <AK/Traits.h>
|
#include <AK/Traits.h>
|
||||||
|
@ -111,6 +112,15 @@ public:
|
||||||
String(const FlyString&);
|
String(const FlyString&);
|
||||||
|
|
||||||
static String repeated(char, size_t count);
|
static String repeated(char, size_t count);
|
||||||
|
|
||||||
|
template<class SeparatorType, class CollectionType>
|
||||||
|
static String join(const SeparatorType& separator, const CollectionType& collection)
|
||||||
|
{
|
||||||
|
StringBuilder builder;
|
||||||
|
builder.join(separator, collection);
|
||||||
|
return builder.build();
|
||||||
|
}
|
||||||
|
|
||||||
bool matches(const StringView& mask, CaseSensitivity = CaseSensitivity::CaseInsensitive) const;
|
bool matches(const StringView& mask, CaseSensitivity = CaseSensitivity::CaseInsensitive) const;
|
||||||
bool matches(const StringView& mask, Vector<MaskSpan>&, CaseSensitivity = CaseSensitivity::CaseInsensitive) const;
|
bool matches(const StringView& mask, Vector<MaskSpan>&, CaseSensitivity = CaseSensitivity::CaseInsensitive) const;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue