19 std::string::size_type pos1 = std::string::npos, pos2;
21 while ((pos1 = str->find_last_of(drop, pos1)) != std::string::npos) {
22 pos2 = str->find_last_not_of(drop, pos1);
23 if (pos2 == std::string::npos) {
24 str->erase(0, pos1 - pos2);
27 str->erase(pos2 + 1, pos1 - pos2);
35 std::string::size_type pos1 = std::string::npos, pos2;
37 while ((pos1 = str->find_last_of(drop, pos1)) != std::string::npos) {
38 pos2 = str->find_last_not_of(drop, pos1);
39 if (pos2 == std::string::npos) {
40 str->erase(0, pos1 - pos2);
43 str->erase(pos2 + 1, pos1 - pos2);
59 out.reserve(str.size());
61 std::string::const_iterator si = str.begin();
62 while (si != str.end()) {
73 out.reserve(str.size());
75 std::string::const_iterator si = str.begin();
76 while (si != str.end()) {
std::string & erase_all(std::string *str, char drop)
Remove all occurrences of the given character in-place.
std::basic_string< char, std::char_traits< char >, Allocator< char > > string
string with Manager tracking