Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. include <algorithm>
  2. include <string>
  3.  
  4. int main()
  5. {
  6.     string s{ "/abc//abc/////cde" };
  7.     s.erase(unique(s.begin(), s.end(), [](char first, char second) {return first == '/' && first == second; }), s.end());
  8.     return 0;
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement