find_last_of [C++ Reference]
Keywords: string,find_last_of
Date: 2009-10-10T20:10:21-0700

[[find_last_of]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- cz
- de
- es
- fr
- it
- jp
- nl
- pl
- ro
- ru
- sk
- tr
- tw

## find_last_of

Syntax:

        #include <string>
        size_type find_last_of( const string& str, size_type index = npos ) const;
        size_type find_last_of( const Char* str, size_type index = npos ) const;
        size_type find_last_of( const Char* str, size_type index, size_type num ) const;
        size_type find_last_of( Char ch, size_type index = npos ) const;

The find_last_of() function either:

- does a reverse search from index, returning the index of the first character within the current string that matches any character in str, or string::npos if nothing is found,
- does a reverse search in the current string, beginning at index, for any of the first num characters in str, returning the index in the current string of the first character found, or string::npos if no characters match,
- or does a reverse search from index, returning the index of the first occurrence of ch in the current string, string::npos if nothing is found.

Related Topics: find, find_first_not_of, find_first_of, find_last_not_of, rfind

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •