Else increment start Also checkin for X at start position
else { if ( s [ start ] == X ) s [ start ] = Y ; start ++ ; } } String new_s = new String ( s ) ; while ( new_s . Length > 0 && new_s [ new_s . Length - 1 ] == Z ) { new_s = new_s . Substring ( 0 , new_s . Length - 1 ) ; } return new_s ; }