首页
IT
登录
6mi
u
盘
搜
搜 索
IT
C++的substr函数的用法
C++的substr函数的用法
xiaoxiao
2021-03-25
112
C++中substr函数的用法 #include<string> #include<iostream> using namespace std; main() { string s("12345asdf"); string a=s.substr(0,3); //获得字符串s中 从第0位开始的长度为3的字符串//默认时的长度为从开始位置到尾 cout<<a<<endl; } 输出结果为: 123
转载请注明原文地址: https://ju.6miu.com/read-18030.html
技术
最新回复
(
0
)