# std::basic_string_view<CharT,Traits>::find_first_of

C++
 Language Standard Library Headers Freestanding and hosted implementations Named requirements Language support library Concepts library (C++20) Diagnostics library Utilities library Strings library Containers library Iterators library Ranges library (C++20) Algorithms library Numerics library Localizations library Input/output library Filesystem library (C++17) Regular expressions library (C++11) Atomic operations library (C++11) Thread support library (C++11) Technical Specifications

Strings library
 Null-terminated strings Byte strings Multibyte strings Wide strings Classes basic_string basic_string_view(C++17) char_traits

std::basic_string_view
 Operations basic_string_view::copy basic_string_view::substr basic_string_view::compare basic_string_view::ends_with(C++20) basic_string_view::find basic_string_view::rfind basic_string_view::find_first_of basic_string_view::find_last_of basic_string_view::find_first_not_of basic_string_view::find_last_not_of Constants basic_string_view::npos Non-member functions operator==operator!=operatoroperator<=operator>=operator<=>(until C++20)(until C++20)(until C++20)(until C++20)(until C++20)(C++20) operator<< operator""sv Helper classes Deduction guides(C++20)

 constexpr size_type find_first_of(basic_string_view v, size_type pos = 0) const noexcept; (1) (since C++17) constexpr size_type find_first_of(CharT c, size_type pos = 0) const noexcept; (2) (since C++17) constexpr size_type find_first_of(const CharT* s, size_type pos, size_type count) const; (3) (since C++17) constexpr size_type find_first_of(const CharT* s, size_type pos = 0) const; (4) (since C++17)

Finds the first character equal to any of the characters in the given character sequence.

1) Finds the first occurence of any of the characters of v in this view, starting at position pos.
2) Equivalent to find_first_of(basic_string_view(std::addressof(c), 1), pos).
3) Equivalent to find_first_of(basic_string_view(s, count), pos).
4) Equivalent to find_first_of(basic_string_view(s), pos).

## Contents

### Parameters

 v - view to search for pos - position at which to start the search count - length of the string of characters to search for s - pointer to a string of characters to search for c - character to search for

### Return value

Position of the first occurrence of any character of the substring, or npos if no such character is found.

### Complexity

O(size() * v.size()) at worst.
{"ft_lang_label":"__label__en","ft_lang_prob":0.69671655,"math_prob":0.744957,"size":1663,"snap":"2020-24-2020-29","text_gpt3_token_len":431,"char_repetition_ratio":0.16576251,"word_repetition_ratio":0.13333334,"special_character_ratio":0.27179796,"punctuation_ratio":0.115523465,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.96861136,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-06-02T09:34:27Z\",\"WARC-Record-ID\":\"<urn:uuid:f3625480-7a5b-4cb6-a0e2-574142643ca9>\",\"Content-Length\":\"47191\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:6e8b8503-a079-4c6c-9466-a8923ea194d7>\",\"WARC-Concurrent-To\":\"<urn:uuid:119cf397-ea64-4044-84e1-b918450f04d2>\",\"WARC-IP-Address\":\"74.114.90.46\",\"WARC-Target-URI\":\"https://en.cppreference.com/w/cpp/string/basic_string_view/find_first_of\",\"WARC-Payload-Digest\":\"sha1:YCATYNSABU34RIF3TY3TCY6OARRSMTPY\",\"WARC-Block-Digest\":\"sha1:DBBEPPJDXK4PUVLMHE2IW6774DQDAAIH\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-24/CC-MAIN-2020-24_segments_1590347423915.42_warc_CC-MAIN-20200602064854-20200602094854-00436.warc.gz\"}"}