String Class in C++
//Use of String class in CPP #include<iostream> #include<string> using namespace std; int main() { string str1="compuhelp";//using = operator cout<<endl<<"String is "<<str1; cout<<endl<<"size of string is "<<str1.size(); cout<<endl<<"Element access "<<str1[0];//displays first char cout<<endl<<"Element at "<<str1.at(1);//displays second char cout<<endl<<endl<<"Display String character by character"<<endl; for(int i=0;i<str1.size();i++) cout<<str1[i]<<" "; cout<<endl<<"second method to display string char by char"<<endl; for(int i=0;i<str1.length();i++) cout<<str1.at(i)<<" "; cout<<endl<<"use of substr function of string "; cout<<endl<<str1.substr(4);//di...