Segment2.extension

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.

struct Segment2
@safe @property const nothrow @nogc
extension
()

Examples

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"));

See Also

stripExtension

Meta