string& trim(string &str, string::size_type pos) { static const string delim = " "; //删除空格或者tab字符 pos = str.find_first_of(delim, pos); if (pos == string::npos) return str; return trim(str.erase(pos, 1)); }