removeDuplicateConsecutiveSubstring

The function removes consecutive string duplicates.

string
removeDuplicateConsecutiveSubstring
(
string s
,
string substring
)

Examples

string s = removeDuplicateConsecutiveSubstring("AAAAbooeAAAuuvAww", "A");
assert(s == "AbooeAuuvAww");
s = removeDuplicateConsecutiveSubstring("AAAAbcooeAAAgguvAww", "AA");
assert(s == "AAbcooeAAAgguvAww");

Meta