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

◆ find_first_not_of() [3/8]

template<typename _CharT, typename _Traits, typename _Alloc>
basic_string< _CharT, _Traits, _Alloc >::size_type std::basic_string< _CharT, _Traits, _Alloc >::find_first_not_of ( const _CharT * __s,
size_type __pos,
size_type __n ) const
nodiscardconstexprnoexcept

Find position of a character not in C substring.

Parameters
__sC string containing characters to avoid.
__posIndex of character to search from.
__nNumber of characters from __s to consider.
Returns
Index of first occurrence.

Starting from __pos, searches forward for a character not contained in the first __n characters of __s within this string. If found, returns the index where it was found. If not found, returns npos.

Definition at line 826 of file basic_string.tcc.

829 {
831 for (; __pos < this->size(); ++__pos)
833 return __pos;
834 return npos;
835 }
#define __glibcxx_requires_string_len(_String, _Len)
Definition debug.h:82
constexpr size_type size() const noexcept
Returns the number of characters in the string, not including any null-termination.
constexpr pointer _M_data() const
static const size_type npos
Value returned by various member functions when they fail.
Managing sequences of characters and character-like objects.

References basic_string(), __glibcxx_requires_string_len, _M_data(), npos, and size().

Here is the call graph for this function: