从URI类型文件路径获取驱动器号的最简单方法是什么
file:///D:/Directory/File.txt
Run Code Online (Sandbox Code Playgroud)
我知道我可以做(这里的路径是一个包含上面文字的字符串)
path = path.Replace(@"file:///", String.Empty);
path = System.IO.Path.GetPathRoot(path);
Run Code Online (Sandbox Code Playgroud)
但感觉有点笨拙.有没有办法在不使用String.Replace或类似的情况下执行此操作?