1、去除空格
string.erase(std::remove_if(string.begin(), string.end(), std::isspace), string.end());
2、去除指定单词
std::string a = "class * A"; a = a.substr(a.find_first_of("* ")+1); //a==A