private void removeCharacters(ConstantValue constantValue){
  assert (constantValue.getValue() instanceof String);
  String oldString=(String)constantValue.getValue();
  for (int i=oldString.length() - 1; i >= 0; i--) {
    String newString=oldString.substring(0,i) + oldString.substring(i + 1);
    constantValue.setValue(newString);
    if (objective.isNotWorse()) {
      oldString=(String)constantValue.getValue();
    }
 else {
      constantValue.setValue(oldString);
    }
  }
}

private void removeCharacters ( ConstantValue constantValue ) { assert ( constantValue . getValue ( ) instanceof String ) ; String oldString = ( String ) constantValue . getValue ( ) ; for ( int i = oldString . length ( ) - 1 ; i >= 0 ; i -- ) { String newString = oldString . substring ( 0 , i ) + oldString . substring ( i + 1 ) ; constantValue . setValue ( newString ) ; if ( objective . isNotWorse ( ) ) { oldString = ( String ) constantValue . getValue ( ) ; } else { constantValue . setValue ( oldString ) ; } } }
shorten the string as much as possible , until the objective value is affected .
