Java File Name Get getFileNameWithoutExtension(File file)

Here you can find the source of getFileNameWithoutExtension(File file)

Description

get File Name Without Extension

License

Apache License

Declaration

public static String getFileNameWithoutExtension(File file) 

Method Source Code

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

import java.io.File;

public class Main {
    public static String getFileNameWithoutExtension(File file) {
        String fileName = file.getName();
        int pos = fileName.lastIndexOf(".");
        if (pos > 0) {
            fileName = fileName.substring(0, pos);
        }/* www  .  ja v a  2s . c  o  m*/
        return fileName;
    }
}

Related

  1. getFileNameWithoutExt(String fileName)
  2. getFileNameWithoutExt(String filePath)
  3. getFileNameWithoutExt(String originPath)
  4. getFilenameWithoutExtension(File f)
  5. getFileNameWithoutExtension(File file)
  6. getFileNameWithoutExtension(File file)
  7. getFileNameWithoutExtension(File file)
  8. getFileNameWithoutExtension(File file)
  9. getFileNameWithoutExtension(File file)