Using algorithm remove_copy_if
:-
string text,result;
std::remove_copy_if(text.begin(), text.end(),
std::back_inserter(result), //Store output
std::ptr_fun<int, int>(&std::ispunct)
);
More Related Contents:
- Parsing a comma-delimited std::string [duplicate]
- How do I check if a C++ std::string starts with a certain string, and convert a substring to an int?
- How to make my split work only on one real line and be capable to skip quoted parts of string?
- Safer but easy-to-use and flexible C++ alternative to sscanf()
- Parse string containing numbers into integer array
- cannot convert ‘std::string’ to ‘char**’ for argument ‘1’ to ‘__ssize_t getline(char**, size_t*, FILE*)’
- Why when i add number to string it shows random text in c++?
- How to parse a string to an int in C++?
- How do I iterate over cin line by line in C++?
- Converting std::__cxx11::string to std::string
- Will std::string always be null-terminated in C++11?
- What’s the rationale for null terminated strings?
- Parse (split) a string in C++ using string delimiter (standard C++)
- stringstream, string, and char* conversion confusion
- How to implode a vector of strings into a string (the elegant way)
- Fast String Hashing Algorithm with low collision rates with 32 bit integer [closed]
- Convert a string to a date in C++
- std::strings’s capacity(), reserve() & resize() functions
- splitting a string into an array in C++ without using vector
- Most optimized way of concatenation in strings
- C++ convert integer to string at compile time
- C++ function to count all the words in a string
- Why doesn’t std::string provide implicit conversion to char*?
- Convert double to string C++? [duplicate]
- Does C# have a String Tokenizer like Java’s?
- How can I make the map::find operation case insensitive?
- Convert std::string to QString
- How do you validate that a string is a valid IPv4 address in C++?
- Reverse String C++ using char array
- C++ – repeatedly using istringstream