#include<iostream>
#include<string>
using namespace std;
int main(){
string s="helloworld";
string a=s.substr(0,4); //substr(startPosition,lenth)
cout << a << endl;//输出hell
}
string之取子串
最新推荐文章于 2022-02-20 22:39:25 发布
#include<iostream>
#include<string>
using namespace std;
int main(){
string s="helloworld";
string a=s.substr(0,4); //substr(startPosition,lenth)
cout << a << endl;//输出hell
}
11万+
3380
2758

被折叠的 条评论
为什么被折叠?