其实用C++中string 有一些函数可以处理这里的问题。 如 str = str.substr(a, b); str.insert(a, s3); int pos = (int) str.find(s4);