Remove more than one consecutive occurrences of pattern characters from modified string .
for ( int i = modifiedString . Length - 1 ; i > 0 ; i -- ) if ( modifiedString [ i ] == modifiedString [ i - 1 ] ) modifiedString . Remove ( i , 1 ) ;