public static String previous(CharSequence self){
  StringBuilder buffer=new StringBuilder(self);
  if (buffer.length() == 0)   throw new IllegalArgumentException("the string is empty");
  char last=buffer.charAt(buffer.length() - 1);
  if (last == Character.MIN_VALUE) {
    buffer.deleteCharAt(buffer.length() - 1);
  }
 else {
    char next=last;
    next--;
    buffer.setCharAt(buffer.length() - 1,next);
  }
  return buffer.toString();
}

public static String previous ( CharSequence self ) { StringBuilder buffer = new StringBuilder ( self ) ; if ( buffer . length ( ) == 0 ) throw new IllegalArgumentException ( "the string is empty" ) ; char last = buffer . charAt ( buffer . length ( ) - 1 ) ; if ( last == Character . MIN_VALUE ) { buffer . deleteCharAt ( buffer . length ( ) - 1 ) ; } else { char next = last ; next -- ; buffer . setCharAt ( buffer . length ( ) - 1 , next ) ; } return buffer . toString ( ) ; }
this method is called by the - - operator for the class charsequence . it decrements the last character in the given charsequence . if the last character in the charsequence is character . min_value it will be deleted . the empty charsequence can ' t be decremented .
