string: std::string * pstr; pstr->substr(0,2); //将pstr从第0个位置开始,分割长度为2 转载于:https://my.oschina.net/u/2473192/blog/512090