If char/string contains a letter

Is there something that checks if a character or string has a specific letter inside it? For example :

1
2
3
4
5
6
7
char x;
cout << "Type a word." << endl;
cin >> x;
if ( ) // if x has the letter a in it //
{
// do this //
}

You can use the find_first_of() string member function.

http://www.cplusplus.com/reference/string/string/find_first_of/

The link contains an example of how to use the function.

Steve
Topic archived. No new replies allowed.