SheetXL - v0.3.20
    Preparing search index...
    • Extracts the base name (file name without extension) from a file path.

      Parameters

      • path: string

        The file path from which to extract the base name.

      • shouldCapitalize: boolean = false

        A boolean flag indicating whether to capitalize the base name. Defaults to false.

      Returns string

      The base name of the file. The base name will be capitalized if shouldCapitalize is true.

      getBaseName("example.txt");       // Returns "Example"
      getBaseName("/path/to/file.jpg"); // Returns "File"
      getBaseName("file_without_extension", false); // Returns "file_without_extension"
      getBaseName("", false); // Returns ""