The function removes consecutive string duplicates.
string s = removeDuplicateConsecutiveSubstring("AAAAbooeAAAuuvAww", "A"); assert(s == "AbooeAuuvAww"); s = removeDuplicateConsecutiveSubstring("AAAAbcooeAAAgguvAww", "AA"); assert(s == "AAbcooeAAAgguvAww");
See Implementation
The function removes consecutive string duplicates.