code: public static String getFileExtension(String fileName) {
          int lastDot = fileName.lastIndexOf('.');
          return (lastDot >= 0) ? fileName.substring(lastDot) : null;
      }
docs: Get the file extension of given fileName.
  
  @return the file extension, or null if there is no file extension