c++ substr string substr (size_t pos = 0, size_t len = npos) const;第一个是位置,第二个是长度,就是从哪里开始截取长度为len的字符串。 转载请注明出处,谢谢。