I want to use the functions of the class the Path ( GetDirectoryName, GetFileName, Combineetc.) with paths in the URL format with a slash (/).
An example of my path:
"xxx://server/folder1/folder2/file"
I tried to complete the task using functions Pathand ended up just replacing the delimiter.
I found that the function GetDirectoryNameincorrectly replaces slashes:
Path.GetDirectoryName(@"xxx://server/folder/file") -> @"xxx:\server\folder"
As you can see, one slash is lost.
How can I make Path functions use an "alternate" separator?
Is it possible to use another class with the same functionality?
source
share