Java File Extension Name Extract extractFileExtension(String fileName)

Here you can find the source of extractFileExtension(String fileName)

Description

extract File Extension

License

Open Source License

Declaration

public static String extractFileExtension(String fileName) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String extractFileExtension(String fileName) {
        if (null == fileName || "".equals(fileName.trim())) {
            throw new IllegalArgumentException("File Name cannot be Null/Empty");
        }/*www  .  j  a  v a 2  s  .  c om*/
        int extensionStartPt = fileName.lastIndexOf(".");
        return fileName.substring(extensionStartPt + 1);
    }
}

Related

  1. extractFileExt(String _sFilePathName)
  2. extractFileExt(String filePath)
  3. ExtractFileExtension(String file_name)
  4. extractFileExtension(String filename)
  5. extractFileExtension(String filename)
  6. extractFileExtension(String fileName)
  7. extractFileExtension(String filename)
  8. extractFileExtension(String filename)