Android File Extension Name Get getExtensionName(String fileName)

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

Description

get Extension Name

License

Apache License

Declaration

public static String getExtensionName(String fileName) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static String getExtensionName(String fileName) {
        if ((fileName != null) && (fileName.length() > 0)) {
            int dot = fileName.lastIndexOf('.');
            if ((dot > -1) && (dot < (fileName.length() - 1))) {
                return fileName.substring(dot + 1).toLowerCase();
            }// ww  w . j  av  a2 s .co  m
        }
        return "";
    }
}

Related

  1. getExtension(File file)
  2. getExtension(File file)
  3. getExtension(File file, boolean useFirstPeriod, boolean includePeriod)
  4. getExtension(String file)
  5. getExtension(String filename)
  6. getFileEx(String filePath)
  7. getFileExt(String fileFullName)
  8. getFileExtByFileName(String fileName)
  9. getFileExtension(String file)