Operation to compress string for repeat characters.