// A sample program to illustrate basic string operations. v. 10/28/02 // - based on example from Dale & Lewis text, 2002 // - no numbers anywhere! #include #include using namespace std; const string TITLE = "How much is that doggie in the window?"; const string CAT = "cat"; int main() { cout << TITLE.length() << endl; cout << TITLE.find( "that" ) << endl; cout << TITLE.find( CAT ) << endl; cout << "\"" << TITLE.substr( 17, 6 ) << "\"" << endl; cout << "\"" << TITLE.substr( 17, 23 ) << "\"" << endl; cout << TITLE.substr( 17, 23 ).length() << endl; return 0; }