Function urlutils::dirname

source ·
pub fn dirname(url: &str, exclude_trailing_slash: bool) -> String
Expand description

Return the parent directory of the given path.

Args: url: Relative or absolute URL exclude_trailing_slash: Remove a final slash (treat http://host/foo/ as http://host/foo, but http://host/ stays http://host/)

Returns: Everything in the URL except the last path chunk