#pragma hdrstop
//#include <condefs.h>
#include <stdio.h>
#include <conio.h>
#include <string>
//---------------------------------------------------------------------------
#pragma argsused
using namespace std;
int main(int argc, char* argv[])
{
string s="Hello world";
int nWordEnd=s.find(' ');
string sub_string1 =s.substr(0,nWordEnd);
printf("Original String :%s/n",s.c_str());
printf("SubString of First Word:%s/n",sub_string1.c_str());
string sub_string2 =s.append(" OK!");
printf("SubString of First Word:%s/n",sub_string2.c_str());
string sub_string3 =s.replace(2,6,"iisss",5);
printf("SubString of First Word:%s/n",sub_string3.c_str());
string sub_string4 =s.substr(3,nWordEnd);
printf("SubString of First Word:%s/n",sub_string4.c_str());
string sub_string5 =s.insert(5," a..a..a..");
printf("SubString of First Word:%s/n",sub_string5.c_str());
getch();
return 0;
}