Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include <algorithm>
- include <string>
- int main()
- {
- string s{ "/abc//abc/////cde" };
- s.erase(unique(s.begin(), s.end(), [](char first, char second) {return first == '/' && first == second; }), s.end());
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement