Method GetRootDirectory
GetRootDirectory(IReadOnlyList<string>)
Declaration
public static string GetRootDirectory(IReadOnlyList<string> paths)
Parameters
Returns
GetRootDirectory(string)
Determines the root directory of a given path.
Declaration
public static string GetRootDirectory(string path)
Parameters
| Type |
Name |
Description |
| string |
path |
The path for which to determine the root directory.
|
Returns
| Type |
Description |
| string |
If the root path of the directory is found, it's returned as a string. If not, an empty string is returned.
|
Examples
GetRootDirectory("C:\\temp\\file.txt"); // Returns "C:\\"