The extension part of a file name, including the dot.
If there is no extension, null is returned.
import std.range : empty; assert(extension("file").empty); assert(extension("file.") == "."); assert(extension("file.ext"w) == ".ext"); assert(extension("file.ext1.ext2"d) == ".ext2"); assert(extension(".foo".dup).empty); assert(extension(".foo.ext"w.dup) == ".ext"); static assert(extension("file").empty); static assert(extension("file.ext") == ".ext");