Android File Extension Name Get getFileExtension(String fullFilename, Boolean withDot)

Here you can find the source of getFileExtension(String fullFilename, Boolean withDot)

Description

get File Extension

Declaration

public static String getFileExtension(String fullFilename,
            Boolean withDot) 

Method Source Code

//package com.java2s;

public class Main {
    public static String getFileExtension(String fullFilename,
            Boolean withDot) {/*from   w  ww.  j av  a2  s  .co m*/
        String ext = fullFilename.substring(fullFilename.lastIndexOf(".")
                + (withDot ? 0 : 1), fullFilename.length());
        return ext.toUpperCase();
    }
}

Related

  1. parseFileExtension(String filename)
  2. removeExtension(String file)
  3. removeExtension(String s)
  4. getExtension(final String fileName)
  5. getFileExtenSion(File file)
  6. getFileExtensionOnly(String filename)