C++ 字符串

查找子串

int pos = s.find(substr);

截取子串

strings substr = s.substr(pos, len);
未指定len就是到结尾

转数字

运用stringstream流
需要

#include <sstream>

stringstream ss(s);
ss >> n;

你可能感兴趣的:(C++ 字符串)