Синтаксис:
#include <string> size_type find_first_not_of( const string& str, size_type index = 0 ) const; size_type find_first_not_of( const char* str, size_type index = 0 ) const; size_type find_first_not_of( const char* str, size_type index, size_type num ) const; size_type find_first_not_of( char ch, size_type index = 0 ) const;
Функция find_first_not_of() выполняет действия:
Например, следующий код просматривает строку текста в поисках первого символа, не являющегося строчным символом, пробелом, запятой или дефисом:
string lower_case = "abcdefghijklmnopqrstuvwxyz ,-"; string str = "this is the lower-case part, AND THIS IS THE UPPER-CASE PART"; cout << "first non-lower-case letter in str at: " << str.find_first_not_of(lower_case) << endl;
Функция find_first_not_of() находит первый прописной символ в строке str, начиная с индекса 29, и выводит:
first non-lower-case letter in str at: 29
Смотрите также: find, find_first_not_of, find_first_of, find_last_not_of, find_last_of, rfind