find_last_not_of
Syntax:
#include <string> size_type find_last_not_of( const string& str, size_type index = npos ); size_type find_last_not_of( const char* str, size_type index = npos); size_type find_last_not_of( const char* str, size_type index, size_type num ); size_type find_last_not_of( char ch, size_type index = npos ); 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 |