C++ string find_first_of Search for a single character
#include <iostream> #include <string> using namespace std; int main(int argc, char *argv []) { //from ww w. j a v a2 s . c o m string myString{ "This is my string!" }; found = myString.find_first_of("msg"); if (found != string::npos) { cout << "is found at position: " << found << endl; } return 0; }