std::experimental::basic_string_view<CharT,Traits>::find_first_of
From cppreference.com
< cpp | experimental | basic string view
| constexpr size_type find_first_of(basic_string_view v, size_type pos = 0) const noexcept; |
(1) | (Library Fundamentals TS) |
| constexpr size_type find_first_of(CharT c, size_type pos = 0) const noexcept; |
(2) | (Library Fundamentals TS) |
| constexpr size_type find_first_of(const CharT* s, size_type pos, size_type count) const; |
(3) | (Library Fundamentals TS) |
| constexpr size_type find_first_of(const CharT* s, size_type pos = 0) const; |
(4) | (Library Fundamentals TS) |
指定された文字シーケンス内のいずれかの文字と最初に一致する文字を検索します。
1) このビュー内で、位置
posから開始して、`v`のいずれかの文字の最初の出現箇所を検索します。2) `find_first_of(basic_string_view( &c, 1 ), pos)` と同等です。
3) `find_first_of(basic_string_view( s, count ), pos)` と同等です。
4) `find_first_of(basic_string_view( s ), pos)` と同等です。
目次 |
[編集] パラメータ
| v | - | 検索対象のビュー |
| pos | - | 検索を開始する位置 |
| count | - | 検索対象の文字文字列の長さ |
| s | - | 検索対象の文字文字列へのポインタ |
| 文字 | - | 検索する文字 |
[編集] 戻り値
部分文字列内のいずれかの文字の最初の出現箇所の位置。そのような文字が見つからない場合はnpos。
[編集] 計算量
最悪の場合、O(size() * v.size())。
[編集] 関連項目
| ビュー内の文字を検索する (public member function) | |
| 部分文字列が最後に現れる位置を見つける (public member function) | |
| 文字が最後に現れる位置を見つける (public member function) | |
| 文字が最初に現れない位置を見つける (public member function) | |
| 文字が最後に現れない位置を見つける (public member function) |