Method IsSubDir
IsSubDir(string, string)
Determines if a given path is a subdirectory of another path.
Declaration
public static bool IsSubDir(string candidatePath, string parentDir)
Parameters
Type | Name | Description |
---|---|---|
string | candidatePath | The path to test for subdirectory status. |
string | parentDir | The parent directory path. |
Returns
Type | Description |
---|---|
bool | A boolean representing whether the path is a subdirectory of the parent directory. |
Examples
IsSubDir("C:\\Program Files\\Common Files", "C:\\Program Files"); //Returns true