Macro nodejs_path::basename [−][src]
macro_rules! basename {
($x : expr) => { ... };
($x : expr, $y : expr) => { ... };
}Expand description
Returns the last portion of a path, similar to the Unix basename command. Trailing directory separators are ignored.
assert_eq!(&nodejs_path::basename!("/foo/bar/baz/asdf/quux.html"), "quux.html");
assert_eq!(&nodejs_path::basename!("/foo/bar/baz/asdf/quux.html", ".html"), "quux");
assert_eq!(&nodejs_path::basename!("/foo/bar/baz/asdf/quux.HTML", ".html"), "quux.HTML");