如何只保留其中的数字
string a = "a3b4c!&d";
string::iterator it = remove_if(a.begin(), a.end(), not1(ptr_fun(isdigit)));
a.erase(it, a.end()); // 34
如何只保留string中的数字
最新推荐文章于 2023-09-14 15:24:44 发布
如何只保留其中的数字
string a = "a3b4c!&d";
string::iterator it = remove_if(a.begin(), a.end(), not1(ptr_fun(isdigit)));
a.erase(it, a.end()); // 34