截取substr
//string的操作 #include<iostream> using namespace std; int main() { string a,b; a="abcde"; b=a.substr(1); string c=a.substr(1,3); cout<<a<<endl; cout<<b<<endl; cout<<c<<endl; }