C++ string 类中substr的使用方法

#include<string> #include<iostream> using namespace std; int main() { string x="Hello_World"; /*默认截取从0到npos.重载原型为string substr(_off=0,_count=npos);npos通常表示为string类中不存在的位置,_off表示字符串的开始位置,_count
相关文章
相关标签/搜索