时间:2010-07-24 06:47:41

标签: c++

2 个答案:

答案 0 :(得分:5)

答案 1 :(得分:0)

不是纯粹的STL解决方案,但是Boost String库使这一点变得微不足道:

std::string s = "012X012Y012";
boost::trim_if(s, boost::is_digit());
std::cout << s << std::endl; // Outputs: "X012Y"
相关问题