I am having strings like this \"aaaabbbccccaaffffddcfggghhhh\" and i want to remove repeated characters get a string like this \"abcadcfgh\".
A simplistic implementati
With regex, you can replace (.)\1+ with the replacement string $1.
(.)\1+
$1