Syntax:
#include <string> size_type find_last_not_of( const string& str, size_type index = npos ) const; size_type find_last_not_of( const Char* str, size_type index = npos ) const; size_type find_last_not_of( const Char* str, size_type index, size_type num ) const; size_type find_last_not_of( Char ch, size_type index = npos ) const;
The find_last_not_of() function either:
For example, the following code searches for the last non-lower-case character in a mixed string of characters:
string lower_case = "abcdefghijklmnopqrstuvwxyz"; string str = "abcdefgABCDEFGhijklmnop"; cout << "last non-lower-case letter in str at: " << str.find_last_not_of(lower_case) << endl;
This code displays the following output:
last non-lower-case letter in str at: 13
Related Topics: find, find_first_not_of, find_first_of, find_last_of, rfind