string.find_last_of(substring) : string find « String « C++
- C++
- String
- string find
string.find_last_of(substring)
#include <iostream>
using std::cout;
using std::endl;
#include <string>
using std::string;
int main()
{
string string1( "This is a test string!");
int location;
location = string1.find_last_of( "is" );
cout << "\n\n(find_last_of) found '" << string1[ location ]
<< " at: " << location;
return 0;
}
/*
(find_last_of) found 'i at: 18
*/
Related examples in the same category