The extension part of the file name.
If the file name contains an extension, this returns a forward range with the extension including the leading dot. Otherwise an empty range is returned.
assert(PosixPath("/foo/bar.txt").head2.extension.equal(".txt")); assert(PosixPath("/foo/bar").head2.extension.equal("")); assert(PosixPath("/foo/.bar").head2.extension.equal("")); assert(PosixPath("/foo/.bar.txt").head2.extension.equal(".txt"));
stripExtension
See Implementation
The extension part of the file name.
If the file name contains an extension, this returns a forward range with the extension including the leading dot. Otherwise an empty range is returned.