Searches the string for the first character that matches any of the characters specified in its arguments.
Syntax:find_first_of( const basic_string &str, size_type index = 0 );
find_first_of( const char *str, size_type index = 0 );
find_first_of( const char *str, size_type index, size_type num );
find_first_of( char ch, size_type index = 0 );
Example:#include // std::cout
#include // std::string
#include // std::size_t
int main ()
{
std::string str ("Please, replace the vowels in this sentence by asterisks.");
std::size_t found = str.find_first_of("aeiou");
while (found!=std::string::npos)
{
str[found]='*';
found=str.find_first_of("aeiou",found+1);
}
std::cout << str << '\n';
return 0;
}
License.
All information of this service is derived from the free sources and is provided solely in the form of quotations.
This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 711 / 159133983. Delta: 0.00248 с