Java File Name Get getFileName(File f)

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

Description

get File Name

License

Apache License

Declaration

public static String getFileName(File f) 

Method Source Code


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

import java.io.File;

public class Main {
    public static String getFileName(File f) {
        int pos = f.getName().lastIndexOf(".");
        String fileName = f.getName().substring(0, pos);
        return fileName;
    }/* ww w.j a  va  2 s  .  c  o m*/
}

Related

  1. getFileName(Class cls, String ext)
  2. getFileName(File element)
  3. getFileName(File f)
  4. getFileName(File f)
  5. getFileName(File file)
  6. getFileName(File file)
  7. getFileName(File file)
  8. getFileName(File file)