public static String removeLast(String string,int characters){
  if (string == null) {
    return null;
  }
  if (characters < 0 || characters > string.length()) {
    return EMPTY;
  }
  return string.substring(0,string.length() - characters);
}

public static String removeLast ( String string , int characters ) { if ( string == null ) { return null ; } if ( characters < 0 || characters > string . length ( ) ) { return EMPTY ; } return string . substring ( 0 , string . length ( ) - characters ) ; }
removes the last given number of characters from the given string . returns null if the string is null . returns an empty string if characters is less than zero or greater than the length of the string .
