C++基础笔记(string截取)
#include <iostream> #include <string> using namespace std; int main(int argc, char* argv[]) { string name("rockderia"); string firstname(name.substr(0,4)); cout << firstname << endl; system("pause"); }
output:rock
posted on 2018-10-04 21:59 Where_Free 阅读(1988) 评论(0) 编辑 收藏 举报