C++ string find_first_of()

Description

C++ string find_first_of()

#include <iostream>
#include <string>
using namespace std;
int main()/* w  w  w .  ja v a 2s . c  o  m*/
{
   string s1 ="aeiou this is a test test another test";
   int n;
   n = s1.find("test");
   cout << "Found at " << n << endl;
   n = s1.find_first_of("is");
   cout << "First at " << n << endl;
   n = s1.find_first_not_of("aeiouAEIOU");
   cout << "First consonent at " << n << endl;
   return 0;
}



PreviousNext

Related