Is it a string::npos : string subscript indexer « string « C++ Tutorial






#include <iostream>
#include <string>

using namespace std;

int main()
{
    string word1 = "Game";
    string word2("Over");
    string word3(3, '!');

    string phrase = word1 + " " + word2 + word3;
    cout << phrase << endl;


    if (phrase.find("eggplant") == string::npos)
        cout << "'eggplant' is not in the phrase.\n\n";

    return 0;
}








15.5.string subscript indexer
15.5.1.Modify char in a string by indexer
15.5.2.Accessing characters in a string
15.5.3.switch statement based on char value
15.5.4.accessing characters in string objects
15.5.5.Is it a string::npos