xor operator is used to flip the
if ( check_bit == 1 ) { if ( str . charAt ( i ) == ' ' ) str = str . substr ( 0 , i ) + ' ' + str . substr ( i + 1 ) ; else str = str . substr ( 0 , i ) + ' ' + str . substr ( i + 1 ) ; }