Wolfram Language & System 10.4 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)


gives the base name for a file without its extension.

Details and OptionsDetails and Options

  • FileBaseName["name.ext"] gives .
  • FileBaseName drops all directory specifications.
  • FileBaseName["file"] gives None if has the form of a directory name.
  • FileBaseName by default assumes pathname separators and other conventions suitable for your operating system.
  • FileBaseName[,OperatingSystem->"os"] uses the conventions of the specified operating system. Possible choices are , , and .
  • FileBaseName just operates on names of files; it does not actually search for the file specified.

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

Find base name of the file:

Click for copyable input

Split off the last extension:

Click for copyable input
Introduced in 2008