stripLeadingDirectory

string
stripLeadingDirectory
(
string s
,)

Return Value

Type: string

the input string with its first directory removed.

Examples

import std.stdio : stderr;

immutable a = stripLeadingDirectory("foo/bar/baz/", "foo");
assert(a == "bar/baz", a);
immutable b = stripLeadingDirectory("/home/user/project/docs", "/home/user/project/docs");
assert(b == "", b);
immutable c = stripLeadingDirectory("/home/user/project/docs/file.name.html",
	"/home/user/project/docs");
assert(c == "file.name.html", c);

Meta