Given a string S, remove duplicates in this string using STL in C++
Input: Geeks for geeks Output: Gefgkors Input: aaaaabbbbbb Output: ab
The consecutive duplicates of the string can be removed using the unique() function provided in STL.
Below is the implementation of the above approach.
- Remove all consecutive duplicates from a string using STL in C++
- Remove duplicates from a sorted array using STL in C++
- Remove duplicates from an unsorted array using STL in C++
- Remove duplicates from an array of small primes
- Remove Trailing Zeros From string in C++
- std::remove, std::remove_if in c++
- list remove() function in C++ STL
- Remove comments from a given C/C++ program
- Find the longest sub-string which is prefix, suffix and also present inside the string
- Remove duplicate elements in an Array using STL in C++
- Find the character in first string that is present at minimum index in second string
- Remove first adjacent pairs of similar characters until possible
- Difference between std::remove and vector::erase for vectors
- Check if a string can become empty by recursively deleting a given sub-string
- Check if a string can be formed from another string using given constraints
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.