code: public static String getFileExtension( String filename )
      {
          int lastDot = filename.lastIndexOf( '.' );
          return lastDot != -1 ? filename.substring( lastDot + 1 ) : "";
      }
docs: Get the file extension from a file name.
  
  @param filename the file name.
  @return the file extension (everything after the last '.'), or the empty string if there is no
  file extension.