This problem appeared in the database context where many
solutions were
suggested. I wonder if RegExp method apply. Given a string,
scan it
from the left to the right and leave only the first
character found.
For example, strings
AAABBCCDDEEA
BBDDDFFAACC
DHSGHDADSFDF
should be compressed into
ABCDE
BDFAC
DHSGAF
correspondingly.