C++ examples for Data Type:string
Insert string to another string, remove characters, replace substring
#include <iostream> #include <string> using namespace std; int main() //w ww. j a v a 2 s . co m { string words = "Something interesting and bizarre"; cout << words << endl; words.insert(10, "seriously "); cout << words << endl; words.erase(19,16); cout << words << endl; words.replace(4, 5, "body"); cout << words << endl; return 0; }