#include #include // compare inserts using namespace std; //string_insert1.cpp int main() { cout<<"\n compare string insert with other operations "; string str1, str2, str3, temp; str1= "Hello World"; str2 ="Good World "; str3 ="Cloud Space"; cout<<"\n using equation \n\ttemp = str1.insert(0,str2); "; temp = str1.insert(0,str2); cout<< "\n \t" << temp; temp =""; cout<< "\n Clearing temp " << temp; cout<<"\n using equation \n\t temp = str3 + " "+str2; "; temp = str3 + " "+str2; cout<< "\n \t" << temp; temp =""; cout<< "\n Clearing temp " << temp; cout<<"\n using equation \n\t temp.insert(0, str3,0, string::npos); "; temp.insert(0, str3,0, string::npos); cout<< "\n \t" << temp; temp =""; cout<< "\n Clearing temp " << temp; cout<<"\n using equation \n\t temp.insert(0, str3,5, npos); "; temp.insert(0, str3,5, string::npos); cout<< "\n \t" << temp; temp =""; cout<< "\n Clearing temp " << temp; return 0; }