1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-21 15:25:07 +00:00

AK: Add StringView::contains(StringView)

This commit is contained in:
AnotherTest 2020-07-04 22:34:00 +04:30 committed by Andreas Kling
parent 1ad51325ad
commit fd64be02e0
2 changed files with 6 additions and 0 deletions

View file

@ -178,6 +178,11 @@ bool StringView::contains(char needle) const
return false;
}
bool StringView::contains(const StringView& needle) const
{
return memmem(m_characters, m_length, needle.m_characters, needle.m_length) != nullptr;
}
bool StringView::equals_ignoring_case(const StringView& other) const
{
return StringUtils::equals_ignoring_case(*this, other);