Sintaxe:
#include <string> size_type find_first_not_of( const string& str, size_type index = 0 ) const; size_type find_first_not_of( const charT* str, size_type index = 0 ) const; size_type find_first_not_of( const charT* str, size_type index, size_type num ) const; size_type find_first_not_of( charT ch, size_type index = 0 ) const;
A função find_first_not_of():
Por exemplo, o código seguinte procura numa string de texto pelo primeiro caracter que não é minúsculo, espaço, vírgula ou hífen:
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;
Quando executado, find_first_not_of() encontra a primeira maiúscula em str na posição 29 e mostra a seguinte saída:
first non-lower-case letter in str at: 29
Tópicos Relacionados: find, find_first_not_of, find_first_of, find_last_not_of, find_last_of, rfind