C++ string简单的使用技巧

截取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;
}
View Code
原文地址:https://www.cnblogs.com/helloworld2019/p/10396909.html