public String cropKeepFinalCharacter(String string,char finalChar){
  String cropped=crop(string);
  if ((null == string) || string.equals(cropped)) {
    return string;
  }
  if (cropped.length() == 0) {
    return cropped;
  }
  return cropped + finalChar;
}

public String cropKeepFinalCharacter ( String string , char finalChar ) { String cropped = crop ( string ) ; if ( ( null == string ) || string . equals ( cropped ) ) { return string ; } if ( cropped . length ( ) == 0 ) { return cropped ; } return cropped + finalChar ; }
crops the given string and adds the given final character to the string ' s end . if the string is shorter than the specified string length the given string is not altered .
