// stringmanipex.cpp shows use of string functions

#include <iostream>   
#include <string>

using namespace std;


string name;
string phrase;
string subphrase;
string::size_type position;

int main()
{
  //First we'll play with length()

  name = "Jon Bradstreet";

  cout << name.length() << endl << endl;

  //Now we'll play with find

  phrase = "Rob Base and D.J. EZ-Rock";

  position = phrase.find("D.J.");

  cout << position << endl;

  position = phrase.find("base");

  cout << position << endl << endl;

  //Lastly we'll play with substr

  subphrase = phrase.substr(5,9);

  cout << subphrase << endl;

  return 0;
}
