string dirname(string path)
Remove the last segment from path .
This implementation differs from dirname() in that it will return "" for the input "/" while dirname() will return "/".
""
"/"
dirname()