mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
AK: Enhance String::contains to allow case-insensitive searches
This commit is contained in:
parent
6413acd78c
commit
25e7225782
Notes:
sideshowbarker
2024-07-19 01:49:09 +09:00
Author: https://github.com/tomuta
Commit: 25e7225782
Pull-request: https://github.com/SerenityOS/serenity/pull/3808
Reviewed-by: https://github.com/awesomekling
7 changed files with 54 additions and 8 deletions
|
@ -178,9 +178,9 @@ bool StringView::contains(char needle) const
|
|||
return false;
|
||||
}
|
||||
|
||||
bool StringView::contains(const StringView& needle) const
|
||||
bool StringView::contains(const StringView& needle, CaseSensitivity case_sensitivity) const
|
||||
{
|
||||
return memmem(m_characters, m_length, needle.m_characters, needle.m_length) != nullptr;
|
||||
return StringUtils::contains(*this, needle, case_sensitivity);
|
||||
}
|
||||
|
||||
bool StringView::equals_ignoring_case(const StringView& other) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue