1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:57:44 +00:00

AK: Implement String::find_any_of() and StringView::find_any_of()

This implements StringUtils::find_any_of() and uses it in
String::find_any_of() and StringView::find_any_of(). All uses of
find_{first,last}_of have been replaced with find_any_of(), find() or
find_last(). find_{first,last}_of have subsequently been removed.
This commit is contained in:
Max Wipfli 2021-07-01 18:12:21 +02:00 committed by Andreas Kling
parent 17eddf3ac4
commit 9cc35d1ba3
12 changed files with 44 additions and 52 deletions

View file

@ -73,7 +73,7 @@ Link::Link(String text, const Document& document)
while (index < m_text.length() && (m_text[index] == ' ' || m_text[index] == '\t'))
++index;
auto url_string = m_text.substring_view(index, m_text.length() - index);
auto space_offset = url_string.find_first_of(" \t");
auto space_offset = url_string.find_any_of(" \t");
String url = url_string;
if (space_offset.has_value()) {
url = url_string.substring_view(0, space_offset.value());