Remove 1 - element in each cycle
for ( j = a ; j < str . Length - 1 ; j ++ ) { str = str . Substring ( 0 , j ) + str [ j + 1 ] + str . Substring ( j + 1 ) ; } str = str . Substring ( 0 , j + 1 ) ; s . Pop ( ) ; }