mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:37:35 +00:00
AK: Add StringView::equals_ignoring_case()
StringUtils::equals_ignoring_case() already operates on a StringView&, so StringView should have the method directly without having to go through a temporary String (which also has the method).
This commit is contained in:
parent
6cd4d136a0
commit
1277290a4a
2 changed files with 6 additions and 0 deletions
|
@ -166,6 +166,11 @@ bool StringView::contains(char needle) const
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool StringView::equals_ignoring_case(const StringView& other) const
|
||||||
|
{
|
||||||
|
return StringUtils::equals_ignoring_case(*this, other);
|
||||||
|
}
|
||||||
|
|
||||||
StringView StringView::substring_view(size_t start, size_t length) const
|
StringView StringView::substring_view(size_t start, size_t length) const
|
||||||
{
|
{
|
||||||
ASSERT(start + length <= m_length);
|
ASSERT(start + length <= m_length);
|
||||||
|
|
|
@ -78,6 +78,7 @@ public:
|
||||||
bool ends_with(char) const;
|
bool ends_with(char) const;
|
||||||
bool matches(const StringView& mask, CaseSensitivity = CaseSensitivity::CaseInsensitive) const;
|
bool matches(const StringView& mask, CaseSensitivity = CaseSensitivity::CaseInsensitive) const;
|
||||||
bool contains(char) const;
|
bool contains(char) const;
|
||||||
|
bool equals_ignoring_case(const StringView& other) const;
|
||||||
|
|
||||||
Optional<size_t> find_first_of(char) const;
|
Optional<size_t> find_first_of(char) const;
|
||||||
Optional<size_t> find_first_of(const StringView&) const;
|
Optional<size_t> find_first_of(const StringView&) const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue