Sintaxe:
#include <string> size_type find_last_not_of( const string& str, size_type index = npos ) const; size_type find_last_not_of( const charT* str, size_type index = npos ) const; size_type find_last_not_of( const charT* str, size_type index, size_type num ) const; size_type find_last_not_of( charT ch, size_type index = npos ) const;
A função find_last_not_of():
Por exemplo, o código seguinte procura pelo último caracter que não é minúsculo numa string de caracteres misturados:
string lower_case = "abcdefghijklmnopqrstuvwxyz"; string str = "abcdefgABCDEFGhijklmnop"; cout << "last non-lower-case letter in str at: " << str.find_last_not_of(lower_case) << endl;
Este código mostra a seguinte saída:
last non-lower-case letter in str at: 13
Tópicos Relacionados: find, find_first_not_of, find_first_of, find_last_of, rfind