Get the Base Name of a File

Get the Base Name of a File (the part of the file name before the extension).

Javadoc available at https://www.javatapas.com/docs/javatapas/io/GetFileBaseName.html


public static String getFileBaseName(File inputFile){

  String[] nameTokens = inputFile.getName().split("\\.(?=[^\\.]+$)");

  String baseName = nameTokens[0];

  return baseName;

}