Namespaces
Variants

std::experimental::basic_string_view<CharT,Traits>:: find

From cppreference.net
constexpr size_type find ( basic_string_view v, size_type pos = 0 ) const noexcept ;
(1) (ライブラリ基盤 TS)
constexpr size_type find ( CharT c, size_type pos = 0 ) const noexcept ;
(2) (ライブラリ基盤 TS)
constexpr size_type find ( const CharT * s, size_type pos, size_type count ) const ;
(3) (ライブラリ基盤 TS)
constexpr size_type find ( const CharT * s, size_type pos = 0 ) const ;
(4) (ライブラリ基盤 TS)

指定された文字シーケンスと等しい最初の部分文字列を検索します。

1) このビュー内で位置 pos から開始して、最初に出現する v を検索します。
2) 次と同等: find ( basic_string_view ( & c, 1 ) , pos )
3) 次と同等 find ( basic_string_view ( s, count ) , pos )
4) 次と同等: find ( basic_string_view ( s ) , pos )

目次

パラメータ

v - 検索対象のビュー
pos - 検索を開始する位置
count - 検索する部分文字列の長さ
s - 検索対象の文字列へのポインタ
ch - 検索対象の文字


戻り値

見つかった部分文字列の最初の文字の位置、または npos そのような部分文字列が見つからない場合。

計算量

O( size() * v.size() ) 最悪の場合。

関連項目

部分文字列の最後の出現を検索
(公開メンバ関数)
文字の最初の出現を検索
(公開メンバ関数)
文字の最後の出現を検索
(公開メンバ関数)
文字の最初の不在を検索
(公開メンバ関数)
文字の最後の不在を検索
(公開メンバ関数)