Java File Extension Name Get getFileExtension(File f)

Here you can find the source of getFileExtension(File f)

Description

get File Extension

License

Apache License

Declaration

public static String getFileExtension(File f) 

Method Source Code


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

import java.io.File;

public class Main {
    public static String getFileExtension(File f) {
        String[] split = f.getName().split("\\.");
        if (split.length > 1) {
            return split[1];
        } else {//from   w ww. jav a 2  s . c  o  m
            return null;
        }
    }
}

Related

  1. fileExt(String url)
  2. fileExtension(CharSequence path)
  3. fileExtension(String filename)
  4. fileExtension(String path)
  5. getFileExtension(File _file)
  6. getFileExtension(File f)
  7. getFileExtension(File f)
  8. getFileExtension(File f)
  9. getFileExtension(File f)