libstdc++
GNU C++ library
Loading...
Searching...
No Matches

◆ find() [2/8]

template<typename _CharT, typename _Traits, typename _Alloc>
size_type std::basic_string< _CharT, _Traits, _Alloc >::find ( _CharT __c,
size_type __pos = 0 ) const
noexcept

Find position of a character.

Parameters
__cCharacter to locate.
__posIndex of character to search from (default 0).
Returns
Index of first occurrence.

Starting from __pos, searches forward for __c within this string. If found, returns the index where it was found. If not found, returns npos.