baseName

Get basename of a.

  1. FileName baseName(FilePath a)
  2. DirName baseName(DirPath a)
    @safe pure nothrow
    @nogc => typeof(return)(std_baseName(a.str))
    baseName
  3. DirName baseName(URL a)
  4. FileName baseName(FileURL a)
  5. DirName baseName(DirURL a)

Examples

assert(FilePath("/etc/foo").baseName.str == "foo");
assert(DirPath("/etc/").baseName.str == "etc");
const dmd = "https://github.com/dlang/dmd/";
assert(URL(dmd).baseName.str == "dmd");
assert(FileURL(dmd).baseName.str == "dmd");
assert(DirURL(dmd).baseName.str == "dmd");

Meta